Пример #1
0
 def get(cls):
     items = item_list_schema.dump(CountryModel.find_all())
     if items:
         return {'countries': items}, 200
     return {'message': 'Objects list is empty.'}, 200
 def get(self):
     countries = [country.json() for country in CountryModel.find_all()]
     return {'countries': countries}, 200