Code: Alles auswählen
File "x.py", line 17, in my_function
return Roomtype.get(Roomtype.id == 1).roomtype_de
NameError: global name 'Roomtype' is not defined
Code: Alles auswählen
from bottle import Bottle, route, get, post, request, run, template
from bottle_peewee import PeeweePlugin
app = Bottle()
db = PeeweePlugin('sqlite:///x.db')
@route('/my_function')
def my_function():
return Roomtype.get(Roomtype.id == 1).roomtype_de
app.install(db)