Removed unneeded hasattr(self.rhs, 'get_compiler') checks in db/models/lookups.py.
Unneeded since 9ae4362bec
.
This commit is contained in:
parent
71ff9a74cb
commit
33d453b2a7
|
@ -96,9 +96,7 @@ class Lookup:
|
||||||
return self.get_db_prep_lookup(value, connection)
|
return self.get_db_prep_lookup(value, connection)
|
||||||
|
|
||||||
def rhs_is_direct_value(self):
|
def rhs_is_direct_value(self):
|
||||||
return not(
|
return not hasattr(self.rhs, 'as_sql')
|
||||||
hasattr(self.rhs, 'as_sql') or
|
|
||||||
hasattr(self.rhs, 'get_compiler'))
|
|
||||||
|
|
||||||
def relabeled_clone(self, relabels):
|
def relabeled_clone(self, relabels):
|
||||||
new = copy(self)
|
new = copy(self)
|
||||||
|
@ -410,7 +408,7 @@ class PatternLookup(BuiltinLookup):
|
||||||
# So, for Python values we don't need any special pattern, but for
|
# So, for Python values we don't need any special pattern, but for
|
||||||
# SQL reference values or SQL transformations we need the correct
|
# SQL reference values or SQL transformations we need the correct
|
||||||
# pattern added.
|
# pattern added.
|
||||||
if hasattr(self.rhs, 'get_compiler') or hasattr(self.rhs, 'as_sql') or self.bilateral_transforms:
|
if hasattr(self.rhs, 'as_sql') or self.bilateral_transforms:
|
||||||
pattern = connection.pattern_ops[self.lookup_name].format(connection.pattern_esc)
|
pattern = connection.pattern_ops[self.lookup_name].format(connection.pattern_esc)
|
||||||
return pattern.format(rhs)
|
return pattern.format(rhs)
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue