diff --git a/mainapp/views.py b/mainapp/views.py index 9fdaa76e3..89c16fdb4 100644 --- a/mainapp/views.py +++ b/mainapp/views.py @@ -155,7 +155,10 @@ class Maintenance(TemplateView): def mapdata(request): - data = Request.objects.exclude(latlng__exact="").values() + if("district" in request.GET.keys()): + data = Request.objects.exclude(latlng__exact="").filter(district = request.GET.get("district")).values() + else: + data = Request.objects.exclude(latlng__exact="").values() return JsonResponse(list(data) , safe=False)