diff --git a/events/forms.py b/events/forms.py index 26fe6147..142e77b9 100644 --- a/events/forms.py +++ b/events/forms.py @@ -31,7 +31,7 @@ from django.conf import settings from haystack.query import SearchQuerySet, RelatedSearchQuerySet, SQ from functions.model_utils import EnumChoices -from functions.model_mixin import get_dates +# from functions.model_mixin import get_dates from exposition.models import Exposition from conference.models import Conference from theme.models import Theme, Tag @@ -164,6 +164,13 @@ values_mapping = { } +RATING = ( + (1, _(u'Топовые (HIT)')), + (2, _(u'Члены РСВЯ')), + (3, _(u'Члены UFI')), + (4, _(u'ExpoRating')), +) + monthes_abr_to_num = {v.lower(): k for k, v in enumerate(calendar.month_abbr)} monthes_num_to_abr = {v: k for k, v in monthes_abr_to_num.iteritems()} year_month_regex = re.compile(r'^((?P\d{4})(?P\w{3}))|((?P\d{1,2})/(?P\d{4}))$') @@ -242,7 +249,7 @@ class FilterForm(forms.Form): required=False, widget=FilterCheckboxSelectMultiple()) rating = FilterTypedMultipleChoiceField( label=_(u'Рейтинги'), coerce=int, - choices=[], + choices=RATING, required=False, widget=FilterCheckboxSelectMultiple()) @@ -273,7 +280,12 @@ class FilterForm(forms.Form): def get_dates(self): if not (self.cleaned_data.get('date_from') or self.cleaned_data.get('date_to')): return None - return get_dates(self.cleaned_data.get('date_from'), self.cleaned_data.get('date_to')) + result = '' + if self.cleaned_data.get('date_from'): + result += _(u'c {date_from} ').format(date_from=self.cleaned_data.get('date_from').strftime('%d.%m.%Y')) + if self.cleaned_data.get('date_to'): + result += _(u'по {date_to}').format(date_to=self.cleaned_data.get('date_to').strftime('%d.%m.%Y')) + return result @classmethod def month_choices(cls): diff --git a/events/views.py b/events/views.py index bc5cd0dc..7830de21 100644 --- a/events/views.py +++ b/events/views.py @@ -66,7 +66,6 @@ class FilterListView(ContextMixin, FormMixin, ListView): def get_context_data(self, **kwargs): context = super(FilterListView, self).get_context_data(**kwargs) - # get params for paginator get = self.form.data.copy() if 'page' in get: diff --git a/fabfile.py b/fabfile.py index 108d9346..09e4a5b5 100644 --- a/fabfile.py +++ b/fabfile.py @@ -188,6 +188,7 @@ def update_crontab(): def t1461(): with cd(REMOTE_HOME_DIR): run('pip install chainmap==1.0.2') + run('pip install suds==0.4') run('python manage.py migrate conference') run('python manage.py migrate exposition') run('python manage.py update_events_filter_fields') diff --git a/support/dev/settings.py b/support/dev/settings.py index 32dba066..d82496c5 100644 --- a/support/dev/settings.py +++ b/support/dev/settings.py @@ -153,7 +153,7 @@ MIDDLEWARE_CLASSES = ( # Uncomment the next line for simple clickjacking protection: 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'django.contrib.redirects.middleware.RedirectFallbackMiddleware', - 'proj.middleware.RedirectFallbackMiddleware', + 'proj.middleware.ExpoRedirectFallbackMiddleware', ) diff --git a/support/prod/settings.py b/support/prod/settings.py index 34af55bf..7ff7eede 100644 --- a/support/prod/settings.py +++ b/support/prod/settings.py @@ -153,7 +153,7 @@ MIDDLEWARE_CLASSES = ( # Uncomment the next line for simple clickjacking protection: 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'django.contrib.redirects.middleware.RedirectFallbackMiddleware', - 'proj.middleware.RedirectFallbackMiddleware', + 'proj.middleware.ExpoRedirectFallbackMiddleware', )