#9602: Add admin.site._registry manipulation methods
-------------------------------------+-------------------------------------
     Reporter:  robhudson            |                    Owner:  anonymous
         Type:  New feature          |                   Status:  assigned
    Component:  contrib.admin        |                  Version:  1.0
     Severity:  Normal               |               Resolution:
     Keywords:  register modeladmin  |             Triage Stage:  Accepted
    Has patch:  1                    |      Needs documentation:  1
  Needs tests:  1                    |  Patch needs improvement:  0
Easy pickings:  1                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by anonymous):

 * status:  new => assigned
 * needs_tests:  0 => 1
 * easy:  0 => 1
 * owner:  nobody => anonymous
 * needs_docs:  0 => 1
 * has_patch:  0 => 1


Comment:

 useradmin = admin.site._registry.get(User, None)
 if useradmin:
     useradmin.list_display = useradmin.list_display + ('is_superuser',)
 else:
     class MyUserAdmin(AuthUserAdmin):
         list_display = ('username', 'email', 'first_name', 'last_name',
 'is_staff', 'is_superuser')
     admin.site.register(User, MyUserAdmin)

-- 
Ticket URL: <https://code.djangoproject.com/ticket/9602#comment:4>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" 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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.93a37155408bed69840aaab3d5e68f57%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to