Splitting models.py results in table rename?

25 views
Skip to first unread message

Joshua Russo

unread,
Aug 19, 2011, 10:42:05 PM8/19/11
to django...@googlegroups.com
My models.py was getting too large so I tried to split it into

/models
  __init__.py
  someLogicalGroupOfModels.py
  andSoOn.py

in the __init__.py I have

from appName.models.someLogicalGroupOfModels import *
from appName.models.andSoOn import *

All of my imports still work but the queries are now looking for models_someTableName instead of appName_someTableName. 

I know I've done this before. Is there something I'm doing wrong?

Ramiro Morales

unread,
Aug 19, 2011, 10:56:24 PM8/19/11
to django...@googlegroups.com

Not wrong, you only need a small additional detail:

https://docs.djangoproject.com/en/1.3/ref/models/options/#app-label

--
Ramiro Morales

Joshua Russo

unread,
Aug 19, 2011, 11:13:33 PM8/19/11
to django...@googlegroups.com
Perfect! Thank you
Reply all
Reply to author
Forward
0 new messages