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.
This commit is contained in:
Anubhav Joshi 2014-07-04 00:00:17 +05:30 committed by Tim Graham
parent 136a3ffe21
commit 75ff7b8fb8
6 changed files with 63 additions and 31 deletions

View file

@ -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