django form ModelChoiceField loads all state names while needed states which are mapped with current selected country
- by Sonu
I am using modelChoiceField to display country and state into address form
class StateSelectionwidget(forms.Select):
""" custom widget to state selection"""
class Media:
js = ('media/javascript/public/jquery-1.5.2.min.js', 'media/javascript/public/countrystateselection.js', )
class AddressForm(forms.Form):
name =…