示例#1
0
 def get(self):
     user_id = get_jwt_identity()
     stores =  [store.json() for store  in StoreModel.find_all()]
     if user_id:
         return {'stores':stores},200
     return {'items': [store['name'] for store in stores],
             'message': 'Login or provide authorization header to get detailed item information'
             },200
示例#2
0
    def get(self):
        """
        Get all Store details
        GET /stores
        """
        stores = StoreModel.find_all()

        if stores:
            return {"stores": [store.json() for store in stores]}, 200
        else:
            return {"message": "Sorry, No Store Found!"}, 404
示例#3
0
 def get(self):
     return {'stores': [store.json() for store in StoreModel.find_all()]}
示例#4
0
 def get(self):
     stores = StoreModel.find_all()
     return {"stores": [store.json() for store in stores]}