On 1/11/06, Mike <[EMAIL PROTECTED]> wrote:
> With models, is it common practice to place all models in a single file
> or multiple files? (I have a huge model)

It's most common to put all your models in a single file.

> With views, is it common practice to place all views in a single file?
> It seems like django encourages that by removing the view folder, but I
> don't see why? Multiple view files allows for multiple programmers
> collaborating without running into each other toes.

We originally had "django-admin.py startproject" create a "views"
folder, but that was a bit too "heavy" in terms of directory
structure. Having a single views.py module is much lighter.

But, of course, you can create a views folder and put your views in
it, if you want. In fact, the views can live anywhere on your Python
path -- they don't even have to be in the app package. All the Django
cares about is that they're accessible via Python "dotted-path"
notation, e.g., 'adrian.views.homepage'. Viva decoupling!

Adrian

--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org

Reply via email to