Retrieve a list of all models
Using the query
attribute of our model class, we can retrieve all the results of the query:
resources/item.py
@blp.response(200, ItemSchema(many=True))
def get(self):
return ItemModel.query.all()
resources/store.py
@blp.response(200, StoreSchema(many=True))
def get(self):
return StoreModel.query.all()