However, when I added limit_choices_to to a ForeignKey, makemigrations
didn't detect any changes. This is inconsistent. I suspect it's a bug.
--
Ticket URL: <https://code.djangoproject.com/ticket/24195>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* stage: Unreviewed => Accepted
Comment:
Indeed, it's missing from `ForeignObject.deconstruct()` and
`ManyToManyField.deconstruct()`.
`RelatedField` the common parent of `ForeignObject` and `ManyToManyField`
doesn't have a `deconstruct()` method, since all related fields share some
common options such as `limit_choices_to`, `related_name`, etc. maybe this
is a good opportunity to refactor.
--
Ticket URL: <https://code.djangoproject.com/ticket/24195#comment:1>
* owner: nobody => Adam Bogdał
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/24195#comment:2>
* has_patch: 0 => 1
Comment:
Patch https://github.com/django/django/pull/7493
--
Ticket URL: <https://code.djangoproject.com/ticket/24195#comment:3>
* needs_better_patch: 0 => 1
* version: 1.7 => master
* needs_tests: 0 => 1
Comment:
The patch is looking but it's missing tests.
--
Ticket URL: <https://code.djangoproject.com/ticket/24195#comment:4>
* needs_better_patch: 1 => 0
Comment:
Tests were added.
--
Ticket URL: <https://code.djangoproject.com/ticket/24195#comment:5>
* needs_tests: 1 => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/24195#comment:6>
* needs_better_patch: 0 => 1
* needs_tests: 0 => 1
Comment:
Patch lacks support for `Q` objects which are supported in
`limit_choices_to`
--
Ticket URL: <https://code.djangoproject.com/ticket/24195#comment:7>
* needs_better_patch: 1 => 0
* needs_tests: 1 => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/24195#comment:8>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"cd2fe829dddb4c8914ac62c93cd6d750a4e9c30c" cd2fe82]:
{{{
#!CommitTicketReference repository=""
revision="cd2fe829dddb4c8914ac62c93cd6d750a4e9c30c"
Fixed #24195 -- Deconstructed the limit_choices_to option of related
fields.
Migrations will now be created for changes to limit_choices_to.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/24195#comment:9>