Esempio n. 1
0
 def delete(self, name):
     country = CountryModel.find_by_country(name)
     if country:
         country.delete_from_db()
         return {"message": "Country '{}' deleted".format(name)}, 200
     return {"message": "Country '{}' not found".format(name)}, 404
Esempio n. 2
0
 def get(self, name):
     country = CountryModel.find_by_country(name)
     if country:
         return country.json()
     return {'message': 'Country not found'}, 404