Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Fixed 19077 -- clarified interactions between #430

Closed
wants to merge 2 commits into from

1 participant

@ptone
Collaborator

custom user models and the default UserAdmin ModelAdmin

https://code.djangoproject.com/ticket/19077

@ptone
Collaborator

Addressed in another commit

@ptone ptone closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 7, 2012
  1. @ptone

    Fixed 19077 -- clarified interactions between

    ptone authored
    custom user models and the default UserAdmin ModelAdmin
  2. @ptone
This page is out of date. Refresh to see the latest.
Showing with 17 additions and 3 deletions.
  1. +17 −3 docs/topics/auth.txt
View
20 docs/topics/auth.txt
@@ -1997,9 +1997,23 @@ auth views.
Custom users and django.contrib.admin
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-If you want your custom User model to also work with Admin, your User model must
-define some additional attributes and methods. These methods allow the admin to
-control access of the User to admin content:
+If you want your custom user model to also work with the authentication
+system's default :class:`~django.contrib.admin.ModelAdmin`
+(:class:`django.contrib.auth.admin.UserAdmin`), your user model must meet some
+additional criteria. The permission related methods are required and used by
+the admin to control access of the User to admin content:
+
+.. note::
+
+ Your custom user does not need to use the ModelAdmin provided by
+ contrib.auth in order to be usable by the admin
+ :class:`~django.contrib.auth.admin.UserAdmin` can be subclassed or
+ replaced based on the details of your custom user.
+
+.. attribute:: User.username
+
+ ``UserAdmin`` assumes that your model will provide a field named 'username'
+ - and that this field is set as the ``USERNAME_FIELD`` for the class.
.. attribute:: User.is_staff
Something went wrong with that request. Please try again.