Replaced own country selection with django-countries package.
This commit is contained in:
@@ -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')),
|
||||
|
||||
Reference in New Issue
Block a user