Opened 7 years ago

Closed 3 years ago

#28458 closed New feature (wontfix)

Add ModelMultipleChoiceField.validate_choices()

Reported by: Daniel Hahler Owned by: gasparb16
Component: Forms Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: yes UI/UX: no

Description (last modified by Tim Graham)

I've done this initially in the context of #27148.

While it is not required to work around this anymore, it still is useful for customization and was ACKed in https://github.com/django/django/pull/7181#issuecomment-261079604.

PR

Change History (10)

comment:1 by Tim Graham, 7 years ago

Description: modified (diff)
Summary: Factor out ModelMultipleChoiceField.validate_choicesAdd ModelMultipleChoiceField.validate_choices()
Triage Stage: UnreviewedAccepted

comment:2 by Tim Graham, 7 years ago

Patch needs improvement: set

in reply to:  2 comment:3 by Zach Bresser, 6 years ago

Replying to Tim Graham:

Tim,

I see Blueyed is fairly silent on this. Would you mind if I picked up from his changes and fixed some of the things you pointed out?

comment:4 by Daniel Hahler, 6 years ago

Zach,

please feel free to pick it up.

Thanks!

comment:6 by David Smith, 3 years ago

Easy pickings: set
Owner: nobody removed

comment:7 by gasparb16, 3 years ago

Hi,

I would like to fix the review comments and work on this ticket.
Should I open a new PR with my changes?

comment:8 by David Smith, 3 years ago

Owner: set to gasparb16
Status: newassigned

Hi gasparb16 -- glad to hear of your interest in taking on this ticket. Please do open a new PR over at GitHub when you are ready to do so.

In the meantime I'll allocate the ticket to you. Please go ahead and assign tickets you want to work on to yourself in future. 🙂

comment:9 by Mariusz Felisiak, 3 years ago

Patch needs improvement: unset

comment:10 by Mariusz Felisiak, 3 years ago

Patch needs improvement: set

comment:11 by Mariusz Felisiak, 3 years ago

Resolution: wontfix
Status: assignedclosed

We should have a valid use case if we want to add a new hook. validate_choices() can be used to avoid a queryset evaluation, but I'm not sure it's enough to justify adding it. It's really niche and was more of a workaround than a real need (see #27148). I'm going to say "wontfix" unless there's a more legitimate use-case.

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