Re: Layered Dropdown List

35 views
Skip to first unread message

Xavier Ordoquy

unread,
Dec 24, 2012, 11:47:24 AM12/24/12
to django...@googlegroups.com
Hi,

Le 24 déc. 2012 à 08:43, CodingDaddy <pa...@programmingpapa.com> a écrit :

I would like to ask your advice on how I can implement layered dropdown list.
Let's say I have three tables, one called Country, another called State, and the other called 'City'
And you are adding information about a particular city in admin site.
So I want to have a dropdown like thie

Canada
- BC
- Alberta
US
- California
- New York

I am not implementing about countries and states, but this kind of dropdown box is what I would like to get.
The user or admin can select only the states.

I would appreciate any input I can get.
Thank you for reading my question and I hope to hear from you.

Regards


You'll find how to do this with the MEDIA_CHOICES example here: https://docs.djangoproject.com/en/1.4/ref/models/fields/#choices


Regards,
Xavier Ordoquy,
Linovia.

carlos

unread,
Dec 24, 2012, 3:38:24 PM12/24/12
to django...@googlegroups.com


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

CodingDaddy

unread,
Dec 24, 2012, 5:32:01 PM12/24/12
to django...@googlegroups.com
Hi, Xavier,

Thank you for pointing that out.
I was not specific enough but what I want to do is to dynamically create this nested select from DB table.
In that case, the documentation pointed out to use Foreign Key instead.


CodingDaddy

CodingDaddy

unread,
Dec 24, 2012, 5:32:26 PM12/24/12
to django...@googlegroups.com
Thank you Sacrac
I will give it a try!
Reply all
Reply to author
Forward
0 new messages