Wednesday, August 8, 2012

splitting models.py

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?

I have three apps in a project and one has a models.py with 18 models
and various 1:n and n:m relationships with data-carrying "through" tables.

I wrote a script to split everything up and add the appropriate import
lines to each models .py file. That worked but only after quoting some
model names in relationships and specifically importing unquoted
modelnames in others.

I would love to improve that script so it will work for the other apps.

I'll contribute it back if I get it working.

Thanks for any help

Cheers

Mike

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate