Opened 9 years ago

Closed 8 years ago

#26796 closed Cleanup/optimization (fixed)

Add a check for limit_choices_to on ManyToManyField with an explicit through model

Reported by: Simon Charette Owned by: Kevan Swanberg
Component: Core (System checks) Version: dev
Severity: Normal Keywords: 1.11
Cc: kevswanberg@… Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

As documented:

limit_choices_to has no effect when used on a ManyToManyField with a custom intermediate table specified using the through parameter.

ManyToManyField._check_ignored_options seems like the perfect place to add this check.

Change History (11)

comment:1 by Tim Graham, 9 years ago

Triage Stage: UnreviewedAccepted

comment:2 by Anderson Resende, 8 years ago

Owner: changed from nobody to Anderson Resende
Status: newassigned

comment:3 by Anderson Resende, 8 years ago

What should be the warning message?

in reply to:  3 comment:4 by Simon Charette, 8 years ago

Replying to andersonresende:

What should be the warning message?

Have a look at the other messages in ManyToManyField._check_ignored_options.

Something along the line of limit_choices_to has no effect on ManyToManyField with an explicit intermediary model. should do?

comment:5 by Simon Charette, 8 years ago

Has patch: set

comment:6 by Tim Graham, 8 years ago

Triage Stage: AcceptedReady for checkin

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

Resolution: fixed
Status: assignedclosed

In ba53da89:

Fixed #26796 -- Added a system check for m2m fields with ignored limit_choices_to.

comment:8 by Tim Graham, 8 years ago

Has patch: unset
Keywords: 1.11 added
Resolution: fixed
Status: closednew
Triage Stage: Ready for checkinAccepted

comment:9 by Kevan Swanberg, 8 years ago

Cc: kevswanberg@… added
Has patch: set
Owner: changed from Anderson Resende to Kevan Swanberg
Status: newassigned
Last edited 8 years ago by Tim Graham (previous) (diff)

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

In 17a0a666:

Refs #26796 -- Fixed ManyToManyField's limit_choices_to warning without a through model.

comment:11 by Tim Graham, 8 years ago

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.
Back to Top