{{{
def resolve_expression(self, query=None, allow_joins=True, reuse=None,
summarize=False, for_save=False):
...
}}}
Here we have a couple default arguments. A decent number of callsites for
this method only provide positional arguments. The {{{Exists}}} subclass
assumes keyword-only arguments:
{{{
def resolve_expression(self, query=None, **kwargs):
# As a performance optimization, remove ordering since EXISTS
doesn't
# care about it, just whether or not a row matches.
self.queryset = self.queryset.order_by()
return super(Exists, self).resolve_expression(query, **kwargs)
}}}
I've submitted a patch ([https://github.com/django/django/pull/9671]) that
adds support for positional arguments for {{{Exists.resolve_expression}}},
but perhaps the intention was for the base method to be keyword-only.
--
Ticket URL: <https://code.djangoproject.com/ticket/29118>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* has_patch: 0 => 1
* stage: Unreviewed => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/29118#comment:1>
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"bf26f66029bca94b007a2452679ac004598364a6" bf26f66]:
{{{
#!CommitTicketReference repository=""
revision="bf26f66029bca94b007a2452679ac004598364a6"
Fixed #29118 -- Fixed crash with QuerySet.order_by(Exists(...)).
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/29118#comment:2>
Comment (by Tim Graham <timograham@…>):
In [changeset:"9b5ba2168c737c376a85f13d15808615b21b0b3a" 9b5ba216]:
{{{
#!CommitTicketReference repository=""
revision="9b5ba2168c737c376a85f13d15808615b21b0b3a"
[2.0.x] Fixed #29118 -- Fixed crash with QuerySet.order_by(Exists(...)).
Backport of bf26f66029bca94b007a2452679ac004598364a6 from master
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/29118#comment:3>