I am confused how directory name, file name and class name all work together.
This is what I have at the moment
app.py
database/
client.py
staff.py
order.py
Inside client.py
I have a single class called client
, which acts as the database model (MVC). The same with my other files: staff.py
has a class called staff
, order.py
has order
.
Then in app.py
I do:
from database import client as model
c = model.client()
And then I get confused. In an ideal world this is what I want to do:
Keep my database model classes in separate files in their own directory.
Use them like this:
c = model.client()
o = model.order()
s = model.staff()
The only way I can see to do this is to put all my classes in a single file called model.py
and save this at the root.
I'm sure I am missing something very basic here.