Replaced own country selection with django-countries package.

This commit is contained in:
2018-01-20 15:23:58 +01:00
parent 092ded8cd4
commit 8bb1733427
5 changed files with 16 additions and 14 deletions

View File

@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
from django.utils.translation import ugettext_lazy as _
from django_countries import Countries
class ChoiceSet(object):
@@ -32,6 +33,12 @@ class ChoiceSet(object):
return self._labels[code]
class CountryChoiceSet(Countries):
first = ['DE', 'AU', 'CH', 'FR', 'IT']
first_repeat = True
first_break = '--'
ACCOMMODATION_CHOICES = ChoiceSet([
('NONE', _(u'Keine (tägliche Anreise)')),
('biwi', _(u'Biwak')),
@@ -41,13 +48,7 @@ ACCOMMODATION_CHOICES = ChoiceSet([
('OTHER', _(u'Andere Unterkunft (zusätzliches Feld)')),
])
COUNTRY_CHOICES = ChoiceSet([
('DE', _(u'Deutschland')),
('AU', _(u'Österreich')),
('CH', _(u'Schweiz')),
('FR', _(u'Frankreich')),
('IT', _(u'Italien')),
])
COUNTRY_CHOICES = CountryChoiceSet()
DEADLINE_CHOICES = ChoiceSet([
('month', _(u'Einen Monat vorher')),