Hi Jorge,
On Wednesday 29 May 2013, Jorge C. Leitão wrote:
> Hi there.
>
> Django allows the possibility of putting apps within apps to improve
> structure of the code and increase portability. I find this absolutely
> genial.
>
Actually, Django doesn't. That is, an app is a Python package, and Python
packages can be nested, so you can have app 'b' within app 'a', and in your
installed-apps, have both 'a' and 'a.b'. That will work fine. But as far as
Django is concerned, they are just two separate apps.
Further, the Django docs say specifically[0]:
App names must be unique
The application names (that is, the final dotted part of the path to the
module containing models.py) defined in INSTALLED_APPS must be unique.
For
example, you can’t include both django.contrib.auth and myproject.auth
in
INSTALLED_APPS.
In this, Django follows the Zen of Python, which says (among other things):
Flat is better than nested.
I believe this renders the rest of your solution moot.
The problem you raise -- of name-collisions between elements in apps -- is
valid, but is a result of a long-standing decision; you will need very
convincing arguments to change that.
Hope this helps,
Shai.
[0] https://docs.djangoproject.com/en/dev/ref/settings/#installed-apps
--
You received this message because you are subscribed to the Google Groups
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-developers?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.