#23548: Transform.relabeled_clone calls own constructor with wrong number of
arguments
-------------------------------------+-------------------------------------
Reporter: ris | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: 1.7
(models, ORM) | Keywords: lookup transform orm
Severity: Normal | subquery
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
In
https://github.com/django/django/blob/1.7/django/db/models/lookups.py#L71
:
{{{
def relabeled_clone(self, relabels):
return self.__class__(self.lhs.relabeled_clone(relabels))
}}}
relabeled_clone here calls Transform's own constructor with one argument
(ignoring bound self), but
(https://github.com/django/django/blob/1.7/django/db/models/lookups.py#L59):
{{{
def __init__(self, lhs, lookups):
self.lhs = lhs
self.init_lookups = lookups[:]
}}}
__init__ takes two (non-bound) arguments, so this screws up when you try
and use a QuerySet employing a custom Transform as a subquery.
--
Ticket URL: <https://code.djangoproject.com/ticket/23548>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/046.34b435d2aabc30bc956e2e112b73d96a%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.