Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from flask_restful import Resource, fields, marshal
- country_fields = {
- 'title': fields.String
- }
- class TravelCountryResource(Resource):
- def get(self):
- if request.content_type != 'application/json':
- return 'Cann\'t get travel countries in HTML format', 415
- return {'result': marshal(list(Country.all()), country_fields)}, 200
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement