-2
Ich muss alle Daten von der Tabelle auf HTML-Seite übertragen. In der SQLAlchemy wird es so ähnlich sein.Gibt es eine Möglichkeit, query.all() in peewee abzufragen?
class Author(db.Model):
id = db.Column(db.Integer, primary_key=True)
first = db.Column(db.String(80))
last = db.Column(db.String(80))
@app.route('/authors')
def get_authors():
authors = Author.query.all()
# Serialize the queryset
result = authors_schema.dump(authors)
return jsonify({'authors': result.data})
Gibt es eine etwas wie Autoren = Author.query.all() im Peewee?
http://docs.peewee-orm.com/de/latest/peewee/api.html#Model.select –