[Django] #26796: Add a check for limit_choices_to on ManyToManyField with an explicit through model

9 views
Skip to first unread message

Django

unread,
Jun 23, 2016, 1:14:32 AM6/23/16
to django-...@googlegroups.com
#26796: Add a check for limit_choices_to on ManyToManyField with an explicit
through model
------------------------------------------------+------------------------
Reporter: charettes | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Core (System checks) | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 1
UI/UX: 0 |
------------------------------------------------+------------------------
As
[https://docs.djangoproject.com/en/1.9/ref/models/fields/#django.db.models.ManyToManyField.limit_choices_to
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.

--
Ticket URL: <https://code.djangoproject.com/ticket/26796>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jun 23, 2016, 10:15:38 AM6/23/16
to django-...@googlegroups.com
#26796: Add a check for limit_choices_to on ManyToManyField with an explicit
through model
--------------------------------------+------------------------------------

Reporter: charettes | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Core (System checks) | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by timgraham):

* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/26796#comment:1>

Django

unread,
Jun 26, 2016, 8:57:41 PM6/26/16
to django-...@googlegroups.com
#26796: Add a check for limit_choices_to on ManyToManyField with an explicit
through model
-------------------------------------+-------------------------------------
Reporter: charettes | Owner:
Type: | andersonresende
Cleanup/optimization | Status: assigned
Component: Core (System | Version: master
checks) |

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by andersonresende):

* owner: nobody => andersonresende
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/26796#comment:2>

Django

unread,
Jul 7, 2016, 3:43:22 PM7/7/16
to django-...@googlegroups.com
#26796: Add a check for limit_choices_to on ManyToManyField with an explicit
through model
-------------------------------------+-------------------------------------
Reporter: charettes | Owner:
Type: | andersonresende
Cleanup/optimization | Status: assigned
Component: Core (System | Version: master
checks) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by andersonresende):

What should be the warning message?

--
Ticket URL: <https://code.djangoproject.com/ticket/26796#comment:3>

Django

unread,
Jul 7, 2016, 3:49:21 PM7/7/16
to django-...@googlegroups.com
#26796: Add a check for limit_choices_to on ManyToManyField with an explicit
through model
-------------------------------------+-------------------------------------
Reporter: charettes | Owner:
Type: | andersonresende
Cleanup/optimization | Status: assigned
Component: Core (System | Version: master
checks) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by charettes):

Replying to [comment:3 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?

--
Ticket URL: <https://code.djangoproject.com/ticket/26796#comment:4>

Django

unread,
Jul 7, 2016, 5:36:02 PM7/7/16
to django-...@googlegroups.com
#26796: Add a check for limit_choices_to on ManyToManyField with an explicit
through model
-------------------------------------+-------------------------------------
Reporter: charettes | Owner:
Type: | andersonresende
Cleanup/optimization | Status: assigned
Component: Core (System | Version: master
checks) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by charettes):

* has_patch: 0 => 1


Comment:

[https://github.com/django/django/pull/6894 PR]

--
Ticket URL: <https://code.djangoproject.com/ticket/26796#comment:5>

Django

unread,
Jul 8, 2016, 11:08:22 AM7/8/16
to django-...@googlegroups.com
#26796: Add a check for limit_choices_to on ManyToManyField with an explicit
through model
-------------------------------------+-------------------------------------
Reporter: charettes | Owner:
Type: | andersonresende
Cleanup/optimization | Status: assigned
Component: Core (System | Version: master
checks) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timgraham):

* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/26796#comment:6>

Django

unread,
Jul 8, 2016, 7:37:52 PM7/8/16
to django-...@googlegroups.com
#26796: Add a check for limit_choices_to on ManyToManyField with an explicit
through model
-------------------------------------+-------------------------------------
Reporter: charettes | Owner:
Type: | andersonresende
Cleanup/optimization | Status: closed

Component: Core (System | Version: master
checks) |
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"ba53da894fc713629ae4d3fbdd14eff98c808389" ba53da89]:
{{{
#!CommitTicketReference repository=""
revision="ba53da894fc713629ae4d3fbdd14eff98c808389"
Fixed #26796 -- Added a system check for m2m fields with ignored
limit_choices_to.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/26796#comment:7>

Django

unread,
Jul 15, 2016, 12:46:44 PM7/15/16
to django-...@googlegroups.com
#26796: Add a check for limit_choices_to on ManyToManyField with an explicit
through model
-------------------------------------+-------------------------------------
Reporter: charettes | Owner:
Type: | andersonresende
Cleanup/optimization | Status: new

Component: Core (System | Version: master
checks) |
Severity: Normal | Resolution:
Keywords: 1.11 | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timgraham):

* keywords: => 1.11
* status: closed => new
* has_patch: 1 => 0
* resolution: fixed =>
* stage: Ready for checkin => Accepted


Comment:

Reopening as this
[https://github.com/django/django/commit/ba53da894fc713629ae4d3fbdd14eff98c808389#commitcomment-18263905
doesn't seem to be working correctly].

--
Ticket URL: <https://code.djangoproject.com/ticket/26796#comment:8>

Django

unread,
Jul 21, 2016, 1:26:59 PM7/21/16
to django-...@googlegroups.com
#26796: Add a check for limit_choices_to on ManyToManyField with an explicit
through model
-------------------------------------+-------------------------------------
Reporter: charettes | Owner:
Type: | kevswanberg
Cleanup/optimization | Status: assigned

Component: Core (System | Version: master
checks) |
Severity: Normal | Resolution:
Keywords: 1.11 | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by kevswanberg):

* status: new => assigned

* cc: kevswanberg@… (added)


* has_patch: 0 => 1

* owner: andersonresende => kevswanberg


--
Ticket URL: <https://code.djangoproject.com/ticket/26796#comment:9>

Django

unread,
Jul 21, 2016, 2:32:44 PM7/21/16
to django-...@googlegroups.com
#26796: Add a check for limit_choices_to on ManyToManyField with an explicit
through model
-------------------------------------+-------------------------------------
Reporter: charettes | Owner:
Type: | kevswanberg
Cleanup/optimization | Status: assigned
Component: Core (System | Version: master
checks) |
Severity: Normal | Resolution:
Keywords: 1.11 | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"17a0a6667c3f77908f9427f6489e298c828133e2" 17a0a666]:
{{{
#!CommitTicketReference repository=""
revision="17a0a6667c3f77908f9427f6489e298c828133e2"
Refs #26796 -- Fixed ManyToManyField's limit_choices_to warning without a
through model.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/26796#comment:10>

Django

unread,
Jul 21, 2016, 3:16:13 PM7/21/16
to django-...@googlegroups.com
#26796: Add a check for limit_choices_to on ManyToManyField with an explicit
through model
-------------------------------------+-------------------------------------
Reporter: charettes | Owner:
Type: | kevswanberg
Cleanup/optimization | Status: closed

Component: Core (System | Version: master
checks) |
Severity: Normal | Resolution: fixed

Keywords: 1.11 | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timgraham):

* status: assigned => closed
* resolution: => fixed


--
Ticket URL: <https://code.djangoproject.com/ticket/26796#comment:11>

Reply all
Reply to author
Forward
0 new messages