Good catch. Thank you

On Aug 3, 10:14 pm, "Pedro Valente" <[EMAIL PROTECTED]> wrote:
> I'm not sure if it's your case, but I got the AlreadyRegistered errors
> because before the merge I used the NFA branch and had an admin import
> inside __init__.py (not needed anymore).
>
> I had forgotten about that, and after I got rid of if my app worked fine.
>
> Pedro Valente
>
> On Sun, Aug 3, 2008 at 14:19, Brian Morton <[EMAIL PROTECTED]> wrote:
>
> > As my original post states, my admin registration calls are all in
> > admin.py for each app.  No admin declarations or registrations are
> > going on in my models.
>
> > On Aug 3, 5:55 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> > wrote:
> > > The correct way to handle it is to put all your admin stuff inside
> > > admin.py for each application and than follow these directions:
> >http://www.djangoproject.com/documentation/admin/#hooking-adminsite-i...
>
> > > On Aug 3, 3:32 am, Ludwig <[EMAIL PROTECTED]> wrote:
>
> > > > I encountered the same exception -- it is triggered when, assuming your
> > > > admin registration takes place in models.py, is imported by something
> > else,
> > > > e.g. template tags, inclusion into another model.
>
> > > > A try/except block around the admin registration will suppress this.
>
> > > > While I consider this an inelegant hack, I am not sufficiently steeped
> > in
> > > > the logic of the admin registration to say that such multiple
> > registration
> > > > should or should not trigger an exception. Maybe the developers could
> > > > suggest the right pattern for this.
>
> > > > HTH
>
> > > > Ludwig
>
> > > > 2008/8/2 Brian Morton <[EMAIL PROTECTED]>
>
> > > > > Using revision 8194 from TRUNK (the latest as of writing this post),
> > I
> > > > > am encountering AlreadyRegistered while starting my application.  I
> > > > > have all ModelAdmin definitions in admin.py for my two applications.
> > > > > App2's models file references the app1's model with an import (like
> > in
> > > > >http://code.djangoproject.com/ticket/6776).  However, I am still
> > > > > getting exceptions about each one of my models from app1 being
> > already
> > > > > registered.  If I comment out the admin.site.register lines in
> > > > > app1.admin, only about 1/3 of my models appear in the admin.
>
> > > > > Any ideas what might be causing this?
>
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to