update location filter for sight seeing

This commit is contained in:
Mohamed Nouffer
2022-10-06 18:06:51 +05:30
parent 3ad357f417
commit c6e0cfdeba

View File

@ -140,9 +140,9 @@ def LocationInBound(request):
locs = Location.objects.filter(~Q(cp=0), geom__within=pl, category=cat, event_name__isnull=True) locs = Location.objects.filter(~Q(cp=0), geom__within=pl, category=cat, event_name__isnull=True)
else: else:
if grp: if grp:
locs = Location.objects.filter(geom__within=pl, category=cat, event_name__isnull=True, group__contains=grp) locs = Location.objects.filter(geom__within=pl, category=cat, event_name__isnull=True, group__contains=grp, location_name__contains='観光')
else: else:
locs = Location.objects.filter(geom__within=pl, category=cat, event_name__isnull=True) locs = Location.objects.filter(geom__within=pl, category=cat, event_name__isnull=True, location_name__contains='観光')
else: else:
if is_rog: if is_rog:
if grp: if grp:
@ -151,9 +151,9 @@ def LocationInBound(request):
locs = Location.objects.filter(~Q(cp=0), geom__within=pl, event_name__isnull=True) locs = Location.objects.filter(~Q(cp=0), geom__within=pl, event_name__isnull=True)
else: else:
if grp: if grp:
locs = Location.objects.filter(geom__within=pl, event_name__isnull=True, group__contains=grp) locs = Location.objects.filter(geom__within=pl, event_name__isnull=True, group__contains=grp, location_name__contains='観光')
else: else:
locs = Location.objects.filter(geom__within=pl, event_name__isnull=True) locs = Location.objects.filter(geom__within=pl, event_name__isnull=True, location_name__contains='観光')
if len(locs) > 50: if len(locs) > 50:
return JsonResponse({"too_many_points": True}, safe=False, status=500) return JsonResponse({"too_many_points": True}, safe=False, status=500)
else: else: