'i want to make a chained drop down of my django model
please i want a chained dropdown in such away that it is only when you click on country that state will also be displayed
class PollForm(forms.ModelForm):
class Meta:
model = PollingUnitModel
fields = ['name','country', 'state', 'lga','ward']
i have been thinking of using autocomplete but i don't understand how it works from dal import autocomplete
from django import forms
class PollinForm(forms.ModelForm):
class Meta:
model = PollingUnitModel
fields = ('__all__')
widgets = {
'country': autocomplete.ModelSelect2(url='country-autocomplete')
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
