get_choices() got an unexpected keyword argument 'limit_choices_to'
This method in ForeignObjectRel.get_choices is missing the parameter that
Field.get_choices has.
--
Ticket URL: <https://code.djangoproject.com/ticket/29919>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
Old description:
> Using RelatedOnlyFieldListFilter with ManyToMany causes this exception:
>
> get_choices() got an unexpected keyword argument 'limit_choices_to'
>
> This method in ForeignObjectRel.get_choices is missing the parameter that
> Field.get_choices has.
New description:
Using RelatedOnlyFieldListFilter with ManyToMany causes this exception:
get_choices() got an unexpected keyword argument 'limit_choices_to'
This method in ForeignObjectRel.get_choices is missing the parameter that
Field.get_choices has.
Pull Request: https://github.com/django/django/pull/10606
--
--
Ticket URL: <https://code.djangoproject.com/ticket/29919#comment:1>
Comment (by Tim Graham):
I can't reproduce the crash on a `ManyToManyField` with
`limit_choices_to`. Could you give more details?
--
Ticket URL: <https://code.djangoproject.com/ticket/29919#comment:2>
Old description:
> Using RelatedOnlyFieldListFilter with ManyToMany causes this exception:
>
> get_choices() got an unexpected keyword argument 'limit_choices_to'
>
> This method in ForeignObjectRel.get_choices is missing the parameter that
> Field.get_choices has.
>
> Pull Request: https://github.com/django/django/pull/10606
New description:
Using RelatedOnlyFieldListFilter with ManyToMany causes this exception:
get_choices() got an unexpected keyword argument 'limit_choices_to'
This method in ForeignObjectRel.get_choices is missing the parameter that
Field.get_choices has.
Pull Request: https://github.com/django/django/pull/10606
Demo of how to trigger bug: https://github.com/mgrdcm/django-bug-reverse-
related/blob/master/rrbug/rrapp/admin.py#L11-L15
--
Comment (by Dan Moore):
Apologies for my lack of response on this, have been traveling. I'm going
to be working on adding tests for my fix ASAP but here's a minimal example
of how to trigger: Demo of how to trigger bug: https://github.com/mgrdcm
/django-bug-reverse-related/blob/master/rrbug/rrapp/admin.py#L11-L15
--
Ticket URL: <https://code.djangoproject.com/ticket/29919#comment:3>
Comment (by Dan Moore):
Test case added:
https://github.com/django/django/pull/10606/commits/da4785e82c9586c6f2ab41a0e9e5bc3eeeb8fd1c
--
Ticket URL: <https://code.djangoproject.com/ticket/29919#comment:4>
* stage: Unreviewed => Accepted
Old description:
> Using RelatedOnlyFieldListFilter with ManyToMany causes this exception:
>
> get_choices() got an unexpected keyword argument 'limit_choices_to'
>
> This method in ForeignObjectRel.get_choices is missing the parameter that
> Field.get_choices has.
>
> Pull Request: https://github.com/django/django/pull/10606
>
> Demo of how to trigger bug: https://github.com/mgrdcm/django-bug-
> reverse-related/blob/master/rrbug/rrapp/admin.py#L11-L15
New description:
Using RelatedOnlyFieldListFilter with a reverse ManyToMany relation causes
this exception:
get_choices() got an unexpected keyword argument 'limit_choices_to'
This method in ForeignObjectRel.get_choices is missing the parameter that
Field.get_choices has.
Pull Request: https://github.com/django/django/pull/10606
Demo of how to trigger bug: https://github.com/mgrdcm/django-bug-reverse-
related/blob/master/rrbug/rrapp/admin.py#L11-L15
--
--
Ticket URL: <https://code.djangoproject.com/ticket/29919#comment:5>
* needs_better_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/29919#comment:6>
* needs_better_patch: 1 => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/29919#comment:7>
* cc: Collin Anderson (added)
* needs_better_patch: 0 => 1
* needs_tests: 0 => 1
Comment:
Tim says "test should very the correct results of the Filter rather than
just checking that an exception isn't raised."
--
Ticket URL: <https://code.djangoproject.com/ticket/29919#comment:8>
* needs_better_patch: 1 => 0
* needs_tests: 1 => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/29919#comment:9>
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"bc94e3c1a263da4b3eae3111c12270744907901b" bc94e3c]:
{{{
#!CommitTicketReference repository=""
revision="bc94e3c1a263da4b3eae3111c12270744907901b"
Fixed #29919 -- Fixed RelatedOnlyFieldListFilter crash with reverse
relationships.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/29919#comment:10>