Store multiple countries sorted to DB
jedie opened this issue · comments
The countries should be stored ordered. So low level database lookups can be easier made.
As a work-a-round is to use permutations
e.g.:
gas_countries = list(','.join(codes) for codes in permutations(['DE', 'AT', 'CH']))
MyModel.objects.exclude(countries__in=gas_countries).update(countries='AT,CH,DE')
A other example: Create a Admin change list filter by countries results in permutations ;)