From 560e8ae4378919b6d9cf73128daa0f73e4bf582b Mon Sep 17 00:00:00 2001 From: Slava Kyrachevsky Date: Tue, 14 Feb 2017 15:17:53 +0200 Subject: [PATCH] =?UTF-8?q?=D1=84=D0=B8=D0=BA=D1=81=20=D0=BE=D1=82=D0=BE?= =?UTF-8?q?=D0=B1=D1=80=D0=B0=D0=B6=D0=B5=D0=BD=D0=B8=D1=8F=20=D1=81=D1=82?= =?UTF-8?q?=D1=80=D0=B0=D0=BD=20=D0=B2=20=D0=B0=D0=B4=D0=BC=D0=B8=D0=BD?= =?UTF-8?q?=D0=BA=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/conference/forms.py | 2 +- apps/exposition/forms.py | 2 +- apps/place_exposition/forms.py | 2 +- proj/admin.py | 2 +- static/custom_js/main.js | 27 ++++++++++--------- .../place_exposition/place_exposition.html | 8 +++--- 6 files changed, 22 insertions(+), 21 deletions(-) diff --git a/apps/conference/forms.py b/apps/conference/forms.py index e647c33e..8d034de4 100644 --- a/apps/conference/forms.py +++ b/apps/conference/forms.py @@ -56,7 +56,7 @@ class ConferenceCreateForm(forms.Form): #organiser = forms.MultipleChoiceField(label=u'Организаторы', required=False, # choices=[(item.id, item.name) for item in Organiser.objects.language().all()]) org = forms.CharField(required=False, label=_(u'Организатор')) - country = forms.ChoiceField(label=_(u'Страна'), choices=[(c.id, c.name) for c in Country.objects.language().all()]) + country = forms.ChoiceField(label=_(u'Страна'), choices=list(set([(c.id, c.name) for c in Country.objects.language().all()]))) theme = forms.MultipleChoiceField(label=_(u'Тематики'), choices=[(item.id, item.name) for item in Theme.objects.language().all()]) diff --git a/apps/exposition/forms.py b/apps/exposition/forms.py index 05172454..ed495358 100644 --- a/apps/exposition/forms.py +++ b/apps/exposition/forms.py @@ -49,7 +49,7 @@ class ExpositionCreateForm(forms.Form): #company = forms.MultipleChoiceField(label=u'Компании', required=False, # choices=[(item.id, item.name) for item in Company.objects.language().all()] ) - country = forms.ChoiceField(label=_(u'Страна'), choices=[(c.id, c.name) for c in Country.objects.language().all()]) + country = forms.ChoiceField(label=_(u'Страна'), choices=list(set([(c.id, c.name) for c in Country.objects.language().all()]))) theme = forms.MultipleChoiceField( label=_(u'Тематики'), choices=[(item.id, item.name) for item in Theme.objects.language().filter(types=Theme.types.exposition)]) diff --git a/apps/place_exposition/forms.py b/apps/place_exposition/forms.py index aca9867d..ce0f721a 100644 --- a/apps/place_exposition/forms.py +++ b/apps/place_exposition/forms.py @@ -30,7 +30,7 @@ class ExpositionForm(forms.Form): type = forms.ChoiceField(required=False, choices=types) logo = forms.ImageField(label=_(u'Logo'), required=False, max_length=500) - country = forms.ChoiceField(label=_(u'Страна'), choices=[(c.id, c.name) for c in Country.objects.language().all()]) + country = forms.ChoiceField(label=_(u'Страна'), choices=list(set([(c.id, c.name) for c in Country.objects.language().all()]))) # creates select input with empty choices cause it will be filled with ajax city = forms.CharField(label=_(u'Город'), widget=forms.HiddenInput()) diff --git a/proj/admin.py b/proj/admin.py index 2f83ba63..aaf121a5 100644 --- a/proj/admin.py +++ b/proj/admin.py @@ -26,7 +26,7 @@ def ajax_city(request): returns html