[Django] #28096: Cannot Prefetch() when queryset has ModelIterable subclass

20 views
Skip to first unread message

Django

unread,
Apr 19, 2017, 4:07:56 AM4/19/17
to django-...@googlegroups.com
#28096: Cannot Prefetch() when queryset has ModelIterable subclass
-------------------------------------+-------------------------------------
Reporter: Claude | Owner: nobody
Paroz |
Type: Bug | Status: new
Component: Database | Version: 1.11
layer (models, ORM) |
Severity: Normal | Keywords: regression
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 1
UI/UX: 0 |
-------------------------------------+-------------------------------------
I have a manager with a custom ModelIterable subclass. Unfortunately, I
cannot prefetch on it because of the `queryset._iterable_class is not
ModelIterable` line introduced in
[7ec330eeb96d0874949eacb8ed1bbb97e11807e1].

Could that line make use of `issubclass` instead?

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

Django

unread,
Apr 19, 2017, 4:27:50 AM4/19/17
to django-...@googlegroups.com
#28096: Cannot Prefetch() when queryset has ModelIterable subclass
-------------------------------------+-------------------------------------
Reporter: Claude Paroz | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: 1.11
(models, ORM) |
Severity: Normal | Resolution:
Keywords: regression | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0

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

* has_patch: 0 => 1


Comment:

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

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

Django

unread,
Apr 19, 2017, 9:26:16 AM4/19/17
to django-...@googlegroups.com
#28096: Cannot Prefetch() when queryset has ModelIterable subclass
-------------------------------------+-------------------------------------
Reporter: Claude Paroz | Owner: nobody
Type: Bug | Status: new

Component: Database layer | Version: 1.11
(models, ORM) |
Severity: Normal | Resolution:
Keywords: regression | 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):

* stage: Unreviewed => Ready for checkin


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

Django

unread,
Apr 19, 2017, 1:34:11 PM4/19/17
to django-...@googlegroups.com
#28096: Cannot Prefetch() when queryset has ModelIterable subclass
-------------------------------------+-------------------------------------
Reporter: Claude Paroz | Owner: nobody
Type: Bug | Status: closed

Component: Database layer | Version: 1.11
(models, ORM) |
Severity: Normal | Resolution: fixed

Keywords: regression | 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 Claude Paroz <claude@…>):

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


Comment:

In [changeset:"43b4a1618ed85151494d68778a1bb6304ce1cb79" 43b4a161]:
{{{
#!CommitTicketReference repository=""
revision="43b4a1618ed85151494d68778a1bb6304ce1cb79"
Fixed #28096 -- Allowed prefetch calls with ModelIterable subclasses

Regression in 7ec330eeb96d0874949eacb8ed1bbb97e11807e1.
Thanks Tim Graham for the review.
}}}

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

Django

unread,
Apr 19, 2017, 1:37:51 PM4/19/17
to django-...@googlegroups.com
#28096: Cannot Prefetch() when queryset has ModelIterable subclass
-------------------------------------+-------------------------------------
Reporter: Claude Paroz | Owner: nobody
Type: Bug | Status: closed
Component: Database layer | Version: 1.11
(models, ORM) |
Severity: Normal | Resolution: fixed
Keywords: regression | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

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

Comment (by Claude Paroz <claude@…>):

In [changeset:"61e883c7c268f3460a85be1c66ea1773711cd6c7" 61e883c]:
{{{
#!CommitTicketReference repository=""
revision="61e883c7c268f3460a85be1c66ea1773711cd6c7"
[1.11.x] Fixed #28096 -- Allowed prefetch calls with ModelIterable
subclasses

Regression in 7ec330eeb96d0874949eacb8ed1bbb97e11807e1.
Thanks Tim Graham for the review.

Backport of 43b4a1618ed85151494d68778a1bb6304ce1cb79 from master.
}}}

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

Reply all
Reply to author
Forward
0 new messages