summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorAnubhav Joshi <anubhav9042@gmail.com>2014-07-04 00:00:17 +0530
committerTim Graham <timograham@gmail.com>2014-07-08 08:21:41 -0400
commit75ff7b8fb8335e181ad05e1d4244b4295cc7a105 (patch)
tree1a96dbf9d4670d9d2c35f9a78cfe2c804cceb7ad /docs
parent136a3ffe21988d49e443867d129cc01fb62b34cd (diff)
Fixed #21832 -- Updated prompt, tests, and docs to show that USERNAME_FIELD supports FK after 9bc2d76.
Also added get_input_data() hook in createsuperuser. Thanks Chris Jerdonek and Tim Graham for review.
Diffstat (limited to 'docs')
-rw-r--r--docs/ref/django-admin.txt10
-rw-r--r--docs/releases/1.8.txt3
-rw-r--r--docs/topics/auth/customizing.txt9
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