|
|
|
|
@ -3,6 +3,7 @@ from io import BytesIO
|
|
|
|
|
|
|
|
|
|
import pandas as pd
|
|
|
|
|
from django.core.cache import cache
|
|
|
|
|
from django.db.models import Q
|
|
|
|
|
from django.http import HttpResponse
|
|
|
|
|
from rest_framework import permissions
|
|
|
|
|
from rest_framework.generics import GenericAPIView
|
|
|
|
|
@ -188,6 +189,8 @@ class PlacementPointViewSet(ReadOnlyModelViewSet):
|
|
|
|
|
delta = self.request.GET.get('delta[]')
|
|
|
|
|
fact = self.request.GET.get('fact[]')
|
|
|
|
|
age = self.request.GET.get('age[]')
|
|
|
|
|
included = self.request.GET.get('included[]')
|
|
|
|
|
excluded = self.request.GET.get('excluded[]')
|
|
|
|
|
if location_ids:
|
|
|
|
|
location_ids = list(location_ids.split(','))
|
|
|
|
|
qs = qs.filter(location_id__in=location_ids)
|
|
|
|
|
@ -209,4 +212,11 @@ class PlacementPointViewSet(ReadOnlyModelViewSet):
|
|
|
|
|
if age:
|
|
|
|
|
age = list(age.split(','))
|
|
|
|
|
qs = qs.filter(age__range=age)
|
|
|
|
|
if excluded:
|
|
|
|
|
excluded = list(excluded.split(','))
|
|
|
|
|
qs = qs.filter(~Q(id__in=excluded))
|
|
|
|
|
if included:
|
|
|
|
|
inclded = list(included.split(','))
|
|
|
|
|
qs2 = models.PlacementPoint.objects.filter(id__in=inclded).all()
|
|
|
|
|
qs = (qs | qs2).distinct()
|
|
|
|
|
return qs
|
|
|
|
|
|