On Fri, Aug 14, 2009 at 09:12, Jani Tiainen <[email protected]> wrote:
>
> Vadivel Kumar kirjoitti:
> > I have recently started on Django .. going awesome .. I know, this
> > question might have popped out several times before, but since Google
> > does not yield me any results, I am writing this post. However, do point
> > out resources if any in this mailing list.
> >
> > 1. What is the fundamental difference of APP versus PROJECT in Django
> > terminology. For instance, is it right to say, POSTS is an APP and BLOG
> > is a PROJECT or ORDERS is an APP and ORDER_MANAGEMENT is a PROJECT ..
> >
> > 2. Particularly, I don't like the idea of using a single models.py for
> > many entities, I would rather to keep separate files for each of entity
> > .. in a scenario like a huge team is working on a project, this approach
> > will create unnecessary noise. Any answers?
>
Also keep in mind that models are just Python classes. So to split up your
models in different files, you just set up a directory like this:
project
| - app
| - models (dir)
| - __init__.py
| - post.py
| - comment.py
| - urls.py
| - ...
| - anotherapp..
Then you can import your models as: from app.models.post import Post
or you can import them in you __init__ file and import them as normal
# __init__.py
from post import Post
from comment import Comment
# somewhere else:
from app.models import Post, Comment
Or use a decent versioning system...
Tino
>
>
> http://docs.djangoproject.com/en/dev/intro/tutorial01/#id3
>
> There is answers to both your questions.
> --
> Jani Tiainen
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---