mirror of
https://github.com/django/django.git
synced 2025-06-05 03:29:12 +00:00
Refs #373 -- Delegated Tuple compilation to compiler.
This should allow third-party backends to define Tuple.as_vendor() overrides that are taken into consideration which calling as_sql() directly prevents.
This commit is contained in:
parent
17160819f3
commit
c326cfe3b1
@ -87,7 +87,7 @@ class TupleLookupMixin:
|
|||||||
Value(val, output_field=col.output_field)
|
Value(val, output_field=col.output_field)
|
||||||
for col, val in zip(self.lhs, self.rhs)
|
for col, val in zip(self.lhs, self.rhs)
|
||||||
]
|
]
|
||||||
return Tuple(*args).as_sql(compiler, connection)
|
return compiler.compile(Tuple(*args))
|
||||||
else:
|
else:
|
||||||
sql, params = compiler.compile(self.rhs)
|
sql, params = compiler.compile(self.rhs)
|
||||||
if not isinstance(self.rhs, ColPairs):
|
if not isinstance(self.rhs, ColPairs):
|
||||||
@ -313,7 +313,7 @@ class TupleIn(TupleLookupMixin, In):
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
return Tuple(*result).as_sql(compiler, connection)
|
return compiler.compile(Tuple(*result))
|
||||||
|
|
||||||
def as_sql(self, compiler, connection):
|
def as_sql(self, compiler, connection):
|
||||||
if not self.rhs_is_direct_value():
|
if not self.rhs_is_direct_value():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user