Refactor update_query
This commit is contained in:
@@ -386,13 +386,9 @@ class AggregatedValue(object):
|
|||||||
{self.attr: self.aggregate_query}
|
{self.attr: self.aggregate_query}
|
||||||
)
|
)
|
||||||
if len(self.relationships) == 1:
|
if len(self.relationships) == 1:
|
||||||
remote_pairs = self.relationships[-1].property.local_remote_pairs
|
prop = self.relationships[-1].property
|
||||||
|
|
||||||
return query.where(
|
return query.where(self.local_condition(prop, objects))
|
||||||
remote_pairs[0][0].in_(
|
|
||||||
getattr(obj, remote_pairs[0][1].key) for obj in objects
|
|
||||||
)
|
|
||||||
)
|
|
||||||
else:
|
else:
|
||||||
# Builds query such as:
|
# Builds query such as:
|
||||||
#
|
#
|
||||||
|
Reference in New Issue
Block a user