On 8/08/2012 6:10pm, Russell Keith-Magee wrote:
On Wed, Aug 8, 2012 at 3:27 PM, Mike Dewhirst <[email protected]> wrote:
I would like to understand the "formula" for splitting a monolithic
models.py into ./models/<classname>.py files.
Can someone point to somewhere in the docs or source which sets out the
logic?
There isn't really any "logic" to set out -- you just need to add the
"app_label" meta argument to any model that isn't in a file named
models.py.
Yes, that part is fine ... see below.
https://docs.djangoproject.com/en/dev/ref/models/options/#app-label
If you want some examples of the technique in action, Django's test
suite contains an example in the "tests/modeltests/model_package"
directory.
Ok. The bits I will now try in __init__.py are absolute imports prefixed
by a dot from the future and actually adding the <app-prefix>.modelname
when specifying the related model.
I'm still a little behind but some experimentation may sort it out. I
think I'm in a circular import swirl and need to figure out exactly what
is happening.
Thanks
Mike
Yours,
Russ Magee %-)
--
You received this message because you are subscribed to the Google Groups "Django
users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.