9

I have two dropdownlists in a Django admin site. For example, I have SelectCountry and SelectRegion. Region has a foreignkey relationship to Country. How do I ensure that when a Country is selected, the Regions are filtered based on that Country?

N.B: I am using django-grappelli for my admin backend as well.

Any ideas will be appreciated. Thanks.

4

1 回答 1

7

正如 DrMeers 所暗示的,使用django-smart- selects 。重新发明轮子没有意义。

于 2012-03-25T07:19:40.700 回答