#26837 closed Cleanup/optimization (fixed)
ModelMultipleChoiceField's documentation doesn't mention whether it supports to_field_name
Reported by: | Baptiste Mispelon | Owned by: | Sean Marlow |
---|---|---|---|
Component: | Documentation | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description
The documentation for ModelMultipleChoiceField
[1] doesn't mention whether it supports the to_field_name
parameter like ModelChoideField
[2].
From a quick test, it seems that it does.
This should be documented, and we should also make sure it's tested in case it's not.
[1] https://docs.djangoproject.com/en/dev/ref/forms/fields/#modelmultiplechoicefield
[2] https://docs.djangoproject.com/en/dev/ref/forms/fields/#django.forms.ModelChoiceField.to_field_name
Change History (6)
comment:1 by , 8 years ago
Triage Stage: | Unreviewed → Accepted |
---|---|
Version: | 1.9 → master |
comment:2 by , 8 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
Note:
See TracTickets
for help on using tickets.
I looked into the tests for this ticket and noticed that the
to_field_name
argument is covered for bothModelMultipleChoiceField
andModelChoiceField
.https://github.com/django/django/blob/c9ae09addffb839403312131d4251e9d8b454508/tests/model_forms/tests.py#L2404
However, I noticed that the
empty_label
argument is not covered forModelChoiceField
.Is it okay to add a test for this argument as part of this ticket or should a new ticket be created?I went ahead and created a new ticket for the missing
empty_label
tests. ticket:26843