Opened 8 years ago

Closed 6 years ago

Last modified 5 years ago

#9161 closed (fixed)

ModelMultipleChoiceField doesn't respect to_field_name in validation.

Reported by: Honza Král Owned by: Gregor Müllegger
Component: Forms Version: master
Severity: Keywords: modelchoicefield, modelmultiplechoicefield, to_field_name
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

I believe these should be consistent,

Attachments (2)

9161-against-9072.diff (1.9 KB) - added by Honza Král 8 years ago.
issue9161.2.diff (2.3 KB) - added by Gregor Müllegger 6 years ago.
against r15330

Download all attachments as: .zip

Change History (9)

Changed 8 years ago by Honza Král

Attachment: 9161-against-9072.diff added

comment:1 Changed 8 years ago by Jacob

Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset
Triage Stage: UnreviewedDesign decision needed

comment:2 Changed 7 years ago by Thejaswi Puthraya

Component: UncategorizedDatabase layer (models, ORM)

comment:3 Changed 6 years ago by Gregor Müllegger

Component: Database layer (models, ORM)Forms
Keywords: modelmultiplechoicefield to_field_name added
milestone: 1.3
Owner: changed from nobody to Gregor Müllegger
Status: newassigned
Summary: ModelMultipleChoiceField doesn't accept to_field_name whereas ModelChoiceField doesModelMultipleChoiceField doesn't respect to_field_name in validation.
Triage Stage: Design decision neededReady for checkin

This ticket is still valid. The to_field_name argument was already added to the ModelMultipleChoiceField however it ignores the argument for validation and expects primary keys. I will attach a patch for the current trunk.

You can find the patch also in this github fork/branch: https://github.com/gregmuellegger/django/tree/issue9161

Changed 6 years ago by Gregor Müllegger

Attachment: issue9161.2.diff added

against r15330

comment:4 Changed 6 years ago by Gregor Müllegger

Sorry, patch is against r15440.

comment:5 Changed 6 years ago by Russell Keith-Magee

Resolution: fixed
Status: assignedclosed

In [15587]:

Fixed #9161 -- Ensure that ModelMultipleChoiceField respects to_field_name in validation. Thanks to Honza for the report, and Gregor Müllegger for the patch.

comment:6 Changed 6 years ago by Russell Keith-Magee

In [15588]:

[1.2.X] Fixed #9161 -- Ensure that ModelMultipleChoiceField respects to_field_name in validation. Thanks to Honza for the report, and Gregor Müllegger for the patch.

Backport of r15587 from trunk.

comment:7 Changed 5 years ago by Jacob

milestone: 1.3

Milestone 1.3 deleted

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