Opened 6 years ago

Closed 4 years ago

Last modified 3 years ago

#9161 closed (fixed)

ModelMultipleChoiceField doesn't respect to_field_name in validation.

Reported by: Honza_Kral Owned by: gregmuellegger
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_Kral 6 years ago.
issue9161.2.diff (2.3 KB) - added by gregmuellegger 4 years ago.
against r15330

Download all attachments as: .zip

Change History (9)

Changed 6 years ago by Honza_Kral

comment:1 Changed 6 years ago by jacob

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Design decision needed

comment:2 Changed 6 years ago by thejaswi_puthraya

  • Component changed from Uncategorized to Database layer (models, ORM)

comment:3 Changed 4 years ago by gregmuellegger

  • Component changed from Database layer (models, ORM) to Forms
  • Keywords modelmultiplechoicefield to_field_name added
  • milestone set to 1.3
  • Owner changed from nobody to gregmuellegger
  • Status changed from new to assigned
  • Summary changed from ModelMultipleChoiceField doesn't accept to_field_name whereas ModelChoiceField does to ModelMultipleChoiceField doesn't respect to_field_name in validation.
  • Triage Stage changed from Design decision needed to Ready 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 4 years ago by gregmuellegger

against r15330

comment:4 Changed 4 years ago by gregmuellegger

Sorry, patch is against r15440.

comment:5 Changed 4 years ago by russellm

  • Resolution set to fixed
  • Status changed from assigned to closed

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 4 years ago by russellm

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 3 years ago by jacob

  • milestone 1.3 deleted

Milestone 1.3 deleted

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