π Let us go through a good design to writing APIs. Resources > entity.py #inside resources create a python file for the entity from flask_restful import Resource from models.store import StoreModel class Store(Resource): def get(self, name): #get from models store = storeModel.find_by_name(name) #if got if store: return store.json() #else return {'message': 'Store not found'}, 404 def post(self, name): #check if already exists by get request with the name if storeModel.find_by_name(name): return {'message': 'A Store with name {} already there in database. Use another name.'.format(name)}, 400 #if not the...
Project Weekay | Resume | LinkedIn Profile
NodeJS, AWS, MongoDB, ReactJS, Django, Python, ML with Scikit Learn, Matplotlib, Seaborn
Engineering, UX, Marketing, Product Designing, Business
sayhellotovinit@gmail.com | +91 99239 08880 | Pune, India