mirror of
https://github.com/django/django.git
synced 2025-03-25 08:40:45 +00:00
[1.10.x] Fixed #26837 -- Documented ModelMultipleChoiceField.to_field_name
Backport of 8b9e16ec858c23cb65ea5de95f65a71b31521841 from master
This commit is contained in:
parent
d58a27c349
commit
fda151e512
@ -1209,13 +1209,19 @@ method::
|
|||||||
Allows the selection of one or more model objects, suitable for
|
Allows the selection of one or more model objects, suitable for
|
||||||
representing a many-to-many relation. As with :class:`ModelChoiceField`,
|
representing a many-to-many relation. As with :class:`ModelChoiceField`,
|
||||||
you can use ``label_from_instance`` to customize the object
|
you can use ``label_from_instance`` to customize the object
|
||||||
representations, and ``queryset`` is a required parameter:
|
representations.
|
||||||
|
|
||||||
|
A single argument is required:
|
||||||
|
|
||||||
.. attribute:: queryset
|
.. attribute:: queryset
|
||||||
|
|
||||||
A ``QuerySet`` of model objects from which the choices for the
|
Same as :class:`ModelChoiceField.queryset`.
|
||||||
field will be derived, and which will be used to validate the
|
|
||||||
user's selection.
|
Takes one optional argument:
|
||||||
|
|
||||||
|
.. attribute:: to_field_name
|
||||||
|
|
||||||
|
Same as :class:`ModelChoiceField.to_field_name`.
|
||||||
|
|
||||||
Creating custom fields
|
Creating custom fields
|
||||||
======================
|
======================
|
||||||
|
Loading…
x
Reference in New Issue
Block a user