As double imports should be considered harmful, I'd rather see a
better warning there, in the lines of ""The model Foo is already
registered. This can be caused by a double import, see docs/bar.txt
for ways to avoid it." (Double imports are triggered by mixing
relative and absolute imports, e.g. in "import models" in foo/views.py
and "from project.foo import models" in bar/views.py.)
There should perhaps be a section "How to organize your project and
applications" in main documentation or in the FAQ that would give
clear guidelines for creating reusable applications yet avoiding
double imports.
On Apr 11, 12:56 pm, Simon Willison <
si...@simonwillison.net> wrote:
>
http://code.djangoproject.com/ticket/6776
>
> newforms-admin raises an AlreadyRegistered exception if you attempt to
> register a model with admin.site twice. Unfortunately, due to the
> different places and ways in which a models.py file can be imported
> it's extremely easy to trigger this accidentally, and difficult to
> debug when you do.
>
> The code in question is here:
>
>
http://code.djangoproject.com/browser/django/branches/newforms-admin/...