Skip to content

Commit

Permalink
District wise Map Data filter
Browse files Browse the repository at this point in the history
  • Loading branch information
vigneshhari committed Aug 17, 2018
1 parent b4650f6 commit 5e3d4f1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mainapp/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 5e3d4f1

Please sign in to comment.