mirror of
https://github.com/django/django.git
synced 2025-08-04 10:59:45 +00:00
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:
parent
136a3ffe21
commit
75ff7b8fb8
6 changed files with 63 additions and 31 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue