Is it possible to perform aggregation functions on Django
's RangeField
?
Let's say we have 3 objects with BigIntegerField
price_range
.
1st obj: price_range = [10,5000]
2nd obj: price_range = [1,5000]
3rd obj: price_range = [100,9000]
The result of Max
and Min
aggregation of these three objects would be:
min = 1
and max = 9000
I'm trying to aggregate Max
and Min
this way:
MyModel.objects.aggregate(Min('price_range'),Max('price_range'),)
Which raises error:
ProgrammingError: function min(int8range) does not exist LINE 1: SELECT MIN("app_mymodel"."price_range") AS "price_range__min" FROM "app...