feat(model): added administrative locations (provinces, districts, municipalities) field with full localization support

This commit is contained in:
sankalp committed 2026-01-28 23:51:29 +05:45
1 parent 1e3e3f58bc
commit 3cb7eccf24
6 files changed
+217

No files matched your search

+22
View File
@@ -0,0 +1,22 @@
from django.http import JsonResponse
from django_nepkit.utils import (
get_districts_by_province,
get_municipalities_by_district,
)
def district_list_view(request):
province = request.GET.get("province")
if not province:
return JsonResponse([], safe=False)
data = get_districts_by_province(province)
return JsonResponse(data, safe=False)
def municipality_list_view(request):
district = request.GET.get("district")
if not district:
return JsonResponse([], safe=False)
data = get_municipalities_by_district(district)
return JsonResponse(data, safe=False)