Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#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 Simon Charette, 8 years ago

Triage Stage: UnreviewedAccepted
Version: 1.9master

comment:2 by Sean Marlow, 8 years ago

Owner: changed from nobody to Sean Marlow
Status: newassigned

comment:3 by Sean Marlow, 8 years ago

I looked into the tests for this ticket and noticed that the to_field_name argument is covered for both ModelMultipleChoiceField and ModelChoiceField.

https://github.com/django/django/blob/c9ae09addffb839403312131d4251e9d8b454508/tests/model_forms/tests.py#L2404

However, I noticed that the empty_label argument is not covered for ModelChoiceField.

Is it okay to add a test for this argument as part of this ticket or should a new ticket be created?

Version 0, edited 8 years ago by Sean Marlow (next)

comment:4 by Tim Graham <timograham@…>, 8 years ago

Resolution: fixed
Status: assignedclosed

In 8b9e16ec:

Fixed #26837 -- Documented ModelMultipleChoiceField.to_field_name

comment:5 by Tim Graham <timograham@…>, 8 years ago

In fda151e5:

[1.10.x] Fixed #26837 -- Documented ModelMultipleChoiceField.to_field_name

Backport of 8b9e16ec858c23cb65ea5de95f65a71b31521841 from master

comment:6 by Tim Graham <timograham@…>, 8 years ago

In d5f1736d:

[1.9.x] Fixed #26837 -- Documented ModelMultipleChoiceField.to_field_name

Backport of 8b9e16ec858c23cb65ea5de95f65a71b31521841 from master

Note: See TracTickets for help on using tickets.
Back to Top