Is this not almost trivial to work around by creating a new module
'newapp', importing the original app code from it, and then using
'path.to.newapp' as a new "copy" of the app in INSTALLED_APPS?
Yishai
On Mon, 03 Jun 2013 12:24:38 +0300, Aymeric Augustin
<[email protected]> wrote:
2013/6/3 Jorge C. Leitão <[email protected]>
Motivated by that criticism, I want to ask: why apps have to have unique
names?
Hi Jorge,
Django assumes that a model can be identified by (app_name,
model_name). Long ago — 8 years ago — it didn't seem to be a problem.
I'm not sure your research covers all the consequences of this
assumption.
Anything that hits the app cache depends on this assumption:
- the target of foreign keys can be expressed as 'app_name.ModelName'
- the fixture format identifies models with app_name.ModelName
- several settings have a value in the form app_name.ModelName
- django.contrib.contenttypes uses (app_name, model_name) to identify
each
model
- since permissions are tied to content types, this assumption bleeds to
django.contrib.auth
- etc.
Lifting the requirement of uniqueness would require switching anything
that
uses the app_name.ModelName format to full.path.to.app.ModelName.
That would be quite disruptive, not only for Django, but for the entire
ecosystem of apps, starting with contrib apps. The real question is --
what's the story for authors of pluggable apps ? for users of the
framework
?
As far as I know, the explanation for this behavior lies in history more
than in a design decision. Until now, no one judged this to be enough of
a
problem to make a proposal to fix it. To be honest, it's frighteningly
hard
to fix. Even app-loading (ticket #3591) doesn't tackle it.
--
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.