diff --git a/conference/admin.py b/conference/admin.py index af2f95c5..7e22fc61 100644 --- a/conference/admin.py +++ b/conference/admin.py @@ -159,7 +159,7 @@ def conference_change(request, url): #initial StatisticFormSet StatisticFormSet = modelformset_factory(Statistic, form=StatisticForm, exclude=('conference',)) #fill form with data from database - data = {'web_page':conference.web_page, 'foundation_year': conference.foundation_year, + data = {'web_page':conference.web_page, 'place_alt': conference.place_alt, 'foundation_year': conference.foundation_year, 'data_begin':conference.data_begin, 'data_end':conference.data_end, 'currency':conference.currency, 'tax':conference.tax, 'min_price':conference.min_price, 'max_price':conference.max_price, 'link':conference.link, 'conference_id':conference.id, 'expohit': conference.expohit, @@ -233,7 +233,7 @@ class ConferenceView(AdminView): return super(ConferenceView, self).get_form(form_class) obj = self.set_obj() if obj: - data = {'web_page':obj.web_page, 'foundation_year': obj.foundation_year, + data = {'web_page':obj.web_page, 'place_alt':obj.place_alt, 'foundation_year': obj.foundation_year, 'data_begin':obj.data_begin, 'data_end':obj.data_end, 'currency':obj.currency, 'tax':obj.tax, 'min_price':obj.min_price, 'max_price':obj.max_price, 'link':obj.link, 'conference_id':obj.id, 'expohit': obj.expohit, 'periodic':obj.periodic, diff --git a/conference/forms.py b/conference/forms.py index 897f441b..4cba3c0b 100644 --- a/conference/forms.py +++ b/conference/forms.py @@ -56,6 +56,7 @@ class ConferenceCreateForm(forms.Form): place = forms.ChoiceField(label=u'Место проведения', required=False, choices=places) + place_alt = forms.CharField(label = u"Альтернативное название места", required=False) #creates select input with empty choices cause it will be filled with ajax city = forms.CharField(label=u'Город', widget=forms.HiddenInput()) @@ -160,6 +161,7 @@ class ConferenceCreateForm(forms.Form): conference.canceled = data['canceled'] conference.moved = data['moved'] conference.periodic = data['periodic'] + conference.place_alt = data['place_alt'] # generates bitfield flag = 0 if data['quality_label']: diff --git a/templates/admin/conference/conference.html b/templates/admin/conference/conference.html index 51811f7f..8d6a7f6b 100644 --- a/templates/admin/conference/conference.html +++ b/templates/admin/conference/conference.html @@ -134,6 +134,13 @@ {{ form.place.errors }} + {# place_alt #} +