> I was watching this thread for a while now, and I've got a question.
>
> What is the reason to split the models.py file? I mean, I'm currently
> working on a django project, and the models are pretty "simple" (I
> usually split them into apps) the biggest models file has five or six
> models in the same file. Should I split it? Why?
>
>
To keep each models file small enough that you can find the model you
were looking for quickly, and avoiding a >3k line models.py. One of my
apps has >50 models, having all of them in one file would result in
too much code in one file for my liking.
It splits up the code into nice chunks, making it easier to review,
refactor, modify and document. At least that is the idea.
Cheers
Tom
--
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.
No comments:
Post a Comment