0

In my project, i am using CountryField of django countries inside one of my models. Also, all the countries are displaying in the particular field named 'country'. But what i want is that i have to filter some countries from the list of total countries(one more issue here is that if all the countries are showing, then my template design will remain in conflict. So can anybody help. Thanks in advance.

4

1 回答 1

2

正如医生建议的那样。您可以COUNTRIES_OVERRIDE在设置中使用 dict 。None如果您想从列表中排除这些国家,您可以设置特定国家。喜欢:

COUNTRIES_OVERRIDE = {
    'NZ': _('Middle Earth'),
    'AU': None
}
于 2014-03-14T06:05:58.143 回答