Django countries adding cities to top of list

431 Views Asked by At

Using django-countries which works as expected with django, is it possible to add a list of cities to the top of the countries list, instead of getting all the countries and populating a new country model.

1

There are 1 best solutions below

3
On BEST ANSWER

You can't replace the country object, and really, this isn't meant to be mixed with cities, you should create your own model and implement your own logic.

If you do want to add/override the countries list you can do this, in your setup file:

COUNTRIES_OVERRIDE = {
    'NZ': _('Middle Earth'),
    'AU': None
}

This will define new countries, you can read more about it in the Customization section in the readme of the package.