[1.5.X] Fixed #19402 - Clarified purpose of CustomUser.REQUIRED_FIELDS

Thanks pydanny for the report and ptone for the patch.

Backport of 24a2bcbcdd from master
This commit is contained in:
Tim Graham 2013-02-23 15:42:56 -05:00
parent d1e87eb3ba
commit 1702be89c8
1 changed files with 10 additions and 3 deletions

View File

@ -501,9 +501,16 @@ password resets. You must then provide some key implementation details:
.. attribute:: REQUIRED_FIELDS .. attribute:: REQUIRED_FIELDS
A list of the field names that *must* be provided when creating A list of the field names that *must* be provided when creating a user
a user. For example, here is the partial definition for a User model via the :djadmin:`createsuperuser` management command. The user will be
that defines two required fields - a date of birth and height:: prompted to supply a value for each of these fields. It should include
any field for which :attr:`~django.db.models.Field.blank` is ``False``
or undefined, but may include additional fields you want prompted for
when a user is created interactively. However, it will not work for
:class:`~django.db.models.ForeignKey` fields.
For example, here is the partial definition for a ``User`` model that
defines two required fields - a date of birth and height::
class MyUser(AbstractBaseUser): class MyUser(AbstractBaseUser):
... ...