Re: Django admin - dinamically update through ajax choices of a ChoiceField in a ModelForm

2013-09-21 Thread C. Kirby
If you can, populate the widget with all available choices and then use your JS/AJAX to limit/hide some? On Saturday, September 21, 2013 6:32:03 PM UTC-5, luke lukes wrote: > > Hi everyone. > > I'm stucking with a ModelForm in the admin. I have two ChoicheField which > are populated with choic

Django admin - dinamically update through ajax choices of a ChoiceField in a ModelForm

2013-09-21 Thread luke lukes
Hi everyone. I'm stucking with a ModelForm in the admin. I have two ChoicheField which are populated with choices in __init__: self.fields['city'] = forms.ChoiceField( required=False, ) self.fields['city'].choices=get_cities_tuple(region_code=region_code) self.fields['city'].initial = my_ini