feat: implement zero-config address chaining and revamp documentation

This commit is contained in:
sankalp committed 2026-01-30 14:32:15 +05:45
1 parent b127d925f1
commit 7b07835e0c
7 files changed
+154 -74

No files matched your search

+2 -18
View File
@@ -122,9 +122,7 @@ class RegistrationForm(forms.Form):
## 🗺️ Address Management (Chained Selects)
Model Nepal's administrative structure with automatic filtering: Province → District → Municipality.
### Step 1: Define Fields
Model Nepal's administrative structure with automatic filtering: Province → District → Municipality. This works out-of-the-box without any extra URL configuration.
```python
from django_nepkit import ProvinceField, DistrictField, MunicipalityField
@@ -135,24 +133,10 @@ class Address(models.Model):
district = DistrictField()
municipality = MunicipalityField()
# For Devanagari (बगती, काठमाडौँ, etc.)
# For Devanagari (बागमती, काठमाडौँ, etc.)
# province = ProvinceField(ne=True)
```
### Step 2: Include URLs (Crucial)
For the chained selects to fetch data dynamically, you **must** include the package URLs in your project's `urls.py`:
```python
# urls.py
from django.urls import include, path
urlpatterns = [
# ...
path("nepkit/", include("django_nepkit.urls")),
]
```
---
## 🔌 API Support (Django REST Framework)