Closed agateblue closed 8 years ago
Right now, aggregate always return a dictionary:
aggregate
manager.filter(gender='female').aggregate(lifter.Avg('age'), lifter.Min('age')) # >>> {'age__sum': 289, 'age__min': 15}
As suggested on reddit, it would be nice to return a flat list:
manager.filter(gender='female').aggregate(lifter.Avg('age'), lifter.Min('age'), flat=True) # >>> [289, 15]
This would enable unpacking on aggregates:
avg_age, min_age = manager.filter(gender='female')\ .aggregate(lifter.Avg('age'), lifter.Min('age'), flat=True)
Right now,
aggregate
always return a dictionary:As suggested on reddit, it would be nice to return a flat list:
This would enable unpacking on aggregates: