diff options
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/django-admin.txt | 10 | ||||
| -rw-r--r-- | docs/releases/1.8.txt | 3 | ||||
| -rw-r--r-- | docs/topics/auth/customizing.txt | 9 |
3 files changed, 21 insertions, 1 deletions
diff --git a/docs/ref/django-admin.txt b/docs/ref/django-admin.txt index e67276613a..f6fd81e242 100644 --- a/docs/ref/django-admin.txt +++ b/docs/ref/django-admin.txt @@ -1478,6 +1478,16 @@ it when running interactively. Use the ``--database`` option to specify the database into which the superuser object will be saved. +.. versionadded:: 1.8 + +You can subclass the management command and override ``get_input_data()`` if you +want to customize data input and validation. Consult the source code for +details on the existing implementation and the method's parameters. For example, +it could be useful if you have a ``ForeignKey`` in +:attr:`~django.contrib.auth.models.CustomUser.REQUIRED_FIELDS` and want to +allow creating an instance instead of entering the primary key of an existing +instance. + ``django.contrib.gis`` ---------------------- diff --git a/docs/releases/1.8.txt b/docs/releases/1.8.txt index 631809f5e2..d2c2141415 100644 --- a/docs/releases/1.8.txt +++ b/docs/releases/1.8.txt @@ -49,7 +49,8 @@ Minor features * The ``max_length`` of :attr:`Permission.name <django.contrib.auth.models.Permission.name>` has been increased from 50 to 255 characters. Please run the database migration. -* :attr:`~django.contrib.auth.models.CustomUser.REQUIRED_FIELDS` now supports +* :attr:`~django.contrib.auth.models.CustomUser.USERNAME_FIELD` and + :attr:`~django.contrib.auth.models.CustomUser.REQUIRED_FIELDS` now supports :class:`~django.db.models.ForeignKey`\s. :mod:`django.contrib.formtools` diff --git a/docs/topics/auth/customizing.txt b/docs/topics/auth/customizing.txt index 0b0582775a..be065e4757 100644 --- a/docs/topics/auth/customizing.txt +++ b/docs/topics/auth/customizing.txt @@ -508,6 +508,15 @@ password resets. You must then provide some key implementation details: ... USERNAME_FIELD = 'identifier' + .. versionadded:: 1.8 + + :attr:`USERNAME_FIELD` now supports + :class:`~django.db.models.ForeignKey`\s. Since there is no way to pass + model instances during the :djadmin:`createsuperuser` prompt, expect the + user to enter the value of :attr:`~django.db.models.ForeignKey.to_field` + value (the :attr:`~django.db.models.Field.primary_key` by default) of an + existing instance. + .. attribute:: REQUIRED_FIELDS A list of the field names that will be prompted for when creating a |
