There shouldn't just be one file that holds all of the models.
tko22 opened this issue · 6 comments
tko22 commented
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
can you provide me an example of how to do this ??
tko22 commented
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:
api/
models/
-__init__.py
in whichdb
is initialized here.
-Person.py
-Email.py
I should also be able to do from api.models import Person, Email
and import the Person and Email object
yashg5 commented
Got it. Thank you
yashg5 commented
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
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 ***@***.***> 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
fixed