Possible to have dynamic drop down list in ModelForm?
I have a model FieldReport that has, among other fields, these two
fields:
-country
-city
Both "country" and "city" are lists of choices.
I want to have a form FieldReportForm as a ModelfForm based on the
model FieldReport. I want to have "country" and "city" represented as
drop down lists. Moreover, "city" should be a dynamic list based on
the selected value of "country".
For example, if someone selects the value "US" for "country", then
"city" should be a list of US cities only, all cities in other
countries shouldn't be loaded onto that list.
Is this something that would work with Django's ModelForm? How would
you implement something like this?
Thanks.
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home