|
|
|
|
@ -13,7 +13,7 @@ from django.core.cache import cache
|
|
|
|
|
from django.conf import settings
|
|
|
|
|
from rest_framework.response import Response
|
|
|
|
|
from rest_framework.viewsets import ReadOnlyModelViewSet
|
|
|
|
|
from django.db.models import Avg
|
|
|
|
|
from django.db.models import Avg, Min, Max
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import psycopg2
|
|
|
|
|
@ -134,6 +134,8 @@ def get_middle_bi_values():
|
|
|
|
|
aggregations = {}
|
|
|
|
|
for field_name in fields_to_aggregate:
|
|
|
|
|
aggregations[f'avg_{field_name}'] = Avg(field_name)
|
|
|
|
|
aggregations[f'min_{field_name}'] = Min(field_name)
|
|
|
|
|
aggregations[f'max_{field_name}'] = Max(field_name)
|
|
|
|
|
result = models.PlacementPoint.objects.aggregate(**aggregations)
|
|
|
|
|
return result
|
|
|
|
|
|
|
|
|
|
|