update for user filter on location
This commit is contained in:
@ -205,9 +205,13 @@ def ExtentForMainPerf(request):
|
||||
# iata = serializers.serialize("json",ext)
|
||||
return JsonResponse(ext, safe=False)
|
||||
|
||||
|
||||
@api_view(['POST',])
|
||||
@permission_classes((IsAuthenticated,))
|
||||
@csrf_exempt
|
||||
def ExtentForLocations(request):
|
||||
locs = Location.objects.aggregate(Extent('geom'), Union('geom'))
|
||||
user = request.user
|
||||
print(user.email)
|
||||
locs = Location.objects.filter(group__contains=user.group).aggregate(Extent('geom'), Union('geom'))
|
||||
return JsonResponse(locs['geom__extent'], safe=False)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user