Fix aggregates
This commit is contained in:
@@ -368,10 +368,7 @@ class AggregatedValue(object):
|
||||
[remote],
|
||||
from_obj=[from_]
|
||||
).where(
|
||||
local.in_(
|
||||
getattr(obj, remote.key)
|
||||
for obj in objects
|
||||
)
|
||||
self.local_condition(property_, objects)
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -379,6 +376,16 @@ class AggregatedValue(object):
|
||||
return query
|
||||
|
||||
|
||||
def local_condition(self, prop, objects):
|
||||
return prop.local_remote_pairs[0][0].in_(
|
||||
getattr(
|
||||
obj,
|
||||
prop.local_remote_pairs[0][1].key
|
||||
)
|
||||
for obj in objects
|
||||
)
|
||||
|
||||
|
||||
class AggregationManager(object):
|
||||
def __init__(self):
|
||||
self.reset()
|
||||
|
Reference in New Issue
Block a user