tko22 / flask-boilerplate

Simple flask boilerplate with Postgres, Docker, and Heroku/Zeit now
https://github.com/tko22/flask-boilerplate/wiki
MIT License
301 stars 100 forks source link

There shouldn't just be one file that holds all of the models. #8

Closed tko22 closed 6 years ago

tko22 commented 6 years ago

create a models folder, then move the Person and Email models into different files. Don't forget the init.py and create db instance!

yashg5 commented 6 years ago

can you provide me an example of how to do this ??

tko22 commented 6 years ago

right now, the path to models.py is api/models.py. It may be more modular if we moved it so we would have this structure:

I should also be able to do from api.models import Person, Email and import the Person and Email object

yashg5 commented 6 years ago

Got it. Thank you

yashg5 commented 6 years ago

can you provide me examples to run test cases on post methods with authorization? that would be lot of help to my project.

tko22 commented 6 years ago

there are multiple ways of doing authentication so I can’t give you a specific example. Look into the test client api though. http://flask.pocoo.org/docs/1.0/api/#test-client

On Aug 14, 2018, at 5:30 AM, yashg5 notifications@github.com wrote:

can you provide me examples to run test cases on post methods with authorization? that would be lot of help to my project.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

tko22 commented 6 years ago

fixed