示例#1
0
文件: items.py 项目: Daoortor/API_v4
 def get(self):
     items = Item.get_items()
     return {
         'items': [{
             'name': item.name,
             'price': item.price
         } for item in items]
     }
示例#2
0
文件: items.py 项目: Daoortor/API_v4
 def delete(self):
     if not Item.get_items():
         return {'message': f'There are no items in the store'}, 400
     Item.delete_items()
     return {}, 204