Add preliminary m2m support for aggregates
This commit is contained in:
@@ -432,13 +432,22 @@ class AggregatedValue(object):
|
|||||||
return from_
|
return from_
|
||||||
|
|
||||||
def local_condition(self, prop, objects):
|
def local_condition(self, prop, objects):
|
||||||
return prop.local_remote_pairs[0][0].in_(
|
if prop.secondary is not None:
|
||||||
getattr(
|
return prop.local_remote_pairs[1][0].in_(
|
||||||
obj,
|
getattr(
|
||||||
prop.local_remote_pairs[0][1].key
|
obj,
|
||||||
|
prop.local_remote_pairs[1][0].key
|
||||||
|
)
|
||||||
|
for obj in objects
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
return prop.local_remote_pairs[0][0].in_(
|
||||||
|
getattr(
|
||||||
|
obj,
|
||||||
|
prop.local_remote_pairs[0][1].key
|
||||||
|
)
|
||||||
|
for obj in objects
|
||||||
)
|
)
|
||||||
for obj in objects
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class AggregationManager(object):
|
class AggregationManager(object):
|
||||||
|
Reference in New Issue
Block a user