2009/7/29 Daybreaker <daybreake...@gmail.com>

>
> Um.... My old convention worked well in the testing environment which
> has DEBUG off. (./manage.py test)
>

I tried to say that even if your DEBUG settings are consistent, there may
still be differences in the order in which modules are loaded in different
environments.  Such differences explain the behavior you observed, which is
essentially that the admin views are called to process requests before all
of your registration calls have been made.  DEBUG being on is one easy way
to see how this can happen (as the validation code will force all of your
models.py files to be loaded early).  Without digging more than I have time
for I'm not sure why apparently manage.py, even with DEBUG off, ensures your
models files are loaded sooner rather than later, but that seems to be what
is happening. That has an accidental side-effect of masking the problem
inherent in your old convention, but the problem is still with your old
convention, not the fact that the different environments have different
characteristics here.


>
> Anyway, I have another question:
>
> When using admin.autodiscover(), how do I override the ModelAdmin
> classes provided by Django's original contrib packages like
> contrib.auth? I want to make a customized admin view for User model,
> but if I try to admin.site.register(), it says 'already registered'.
>

admin.site.unregiser(User) before attempting your own registration.  Also be
sure to base your custom User ModelAdmin off of the existing auth one for
User because it has added some custom routines (to support password change,
if I'm remembering correctly) that you will lose if you base off of plain
ModelAdmin.

Karen

--~--~---------~--~----~------------~-------~--~----~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to