def get(self):
     user_id = get_jwt_identity()
     stores = StoreModel.get_all()
     store_array = [store.json() for store in stores]
     if user_id:
         return {"stores": store_array}
     else:
         return {"stores": [{'id': store['id']} for store in store_array]}
示例#2
0
文件: store.py 项目: iebgener/flask6
 def get(self):
     return {'stores': [store.json() for store in StoreModel.get_all()]}
示例#3
0
 def get(self):
     stores = [item.json() for item in StoreModel.get_all()]
     return {'stores': stores}
示例#4
0
 def get(self):
     storesJson = [s.json() for s in StoreModel.get_all()]
     return {'stores': storesJson}