diff --git a/accounts/views.py b/accounts/views.py index 1c2dbaea..1fc611ff 100644 --- a/accounts/views.py +++ b/accounts/views.py @@ -221,12 +221,7 @@ class ProfileCompanyView(TemplateView): return context -class UserView(MetadataMixin, TemplateView): - """ - display user information for another users - """ - template_name = 'client/accounts/user.html' - +class UserMixin(object): def get_user(self): url = self.kwargs.get('url') @@ -238,6 +233,14 @@ class UserView(MetadataMixin, TemplateView): self.kwargs['user_full_name'] = user.get_full_name() return user + +class UserView(UserMixin, MetadataMixin, TemplateView): + """ + display user information for another users + """ + template_name = 'client/accounts/user.html' + + def get_context_data(self, **kwargs): user = self.get_user() context = super(UserView, self).get_context_data(**kwargs) @@ -382,11 +385,11 @@ class UserEventView(ListView): obj = None event_type = None - def get_queryset(self): - url = self.kwargs.get('url') - user = get_user(url) - self.obj = user - return user.exposition_users.language().select_related('country').all() + # def get_queryset(self): + # url = self.kwargs.get('url') + # user = get_user(url) + # self.obj = user + # return user.exposition_users.language().select_related('country').all() def get_context_data(self, **kwargs): context = super(UserEventView, self).get_context_data(**kwargs) @@ -395,29 +398,27 @@ class UserEventView(ListView): return context -class UserExpositionsView(MetadataMixin, UserEventView): +class UserExpositionsView(UserMixin, MetadataMixin, UserEventView): """ return template with list of expos that user joined """ event_type = _(u'Выставки') def get_queryset(self): - url = self.kwargs.get('url') - user = get_user(url) + user = self.get_user() self.obj = user self.kwargs['user_full_name'] = user.get_full_name() return user.get_expos() -class UserConferenceView(MetadataMixin, UserEventView): +class UserConferenceView(UserMixin, MetadataMixin, UserEventView): """ return template with list of confs that user joined """ event_type = _(u'Конференции') def get_queryset(self): - url = self.kwargs.get('url') - user = get_user(url) + user = self.get_user() self.obj = user self.kwargs['user_full_name'] = user.get_full_name() return user.get_confs() diff --git a/conference/urls.py b/conference/urls.py index 157bb0de..d71ab5c9 100644 --- a/conference/urls.py +++ b/conference/urls.py @@ -23,81 +23,81 @@ from .views import ( urlpatterns = patterns('', - url(r'^conference/add-note/(?P.*)/$', 'conference.views.add_note'), + url(r'^conference/add-note/(?P[^/]*)/$', 'conference.views.add_note'), url(r'^conference-add-calendar/(?P\d+)/$', 'conference.views.conference_add_calendar'), url(r'^conference-visit/(?P\d+)/$', 'conference.views.conference_visit'), # search url(r'^conference/search/', ExpositionSearchView.as_view()), # country catalog url(r'^conference/country/$', ConferenceByCountry.as_view(), {'meta_id':51}), - url(r'^conference/country/(?P.*)/(?P\d+)/(?P.*)/page/(?P\d+)/$', ConferenceCountryCatalog.as_view(), {'meta_id':25}), - url(r'^conference/country/(?P.*)/(?P\d+)/page/(?P\d+)/$', ConferenceCountryCatalog.as_view(), {'meta_id':24}), - url(r'^conference/country/(?P.*)/page/(?P\d+)/$', ConferenceCountryCatalog.as_view(), {'meta_id':23}), - url(r'^conference/country/(?P.*)/(?P\d+)/(?P.*)/$', ConferenceCountryCatalog.as_view(), {'meta_id':25}), - url(r'^conference/country/(?P.*)/(?P\d+)/$', ConferenceCountryCatalog.as_view(), {'meta_id':24}), - url(r'^conference/country/(?P.*)/$', ConferenceCountryCatalog.as_view(), {'meta_id':23}), + url(r'^conference/country/(?P[^/]*)/(?P\d+)/(?P[^/]*)/page/(?P\d+)/$', ConferenceCountryCatalog.as_view(), {'meta_id':25}), + url(r'^conference/country/(?P[^/]*)/(?P\d+)/page/(?P\d+)/$', ConferenceCountryCatalog.as_view(), {'meta_id':24}), + url(r'^conference/country/(?P[^/]*)/page/(?P\d+)/$', ConferenceCountryCatalog.as_view(), {'meta_id':23}), + url(r'^conference/country/(?P[^/]*)/(?P\d+)/(?P[^/]*)/$', ConferenceCountryCatalog.as_view(), {'meta_id':25}), + url(r'^conference/country/(?P[^/]*)/(?P\d+)/$', ConferenceCountryCatalog.as_view(), {'meta_id':24}), + url(r'^conference/country/(?P[^/]*)/$', ConferenceCountryCatalog.as_view(), {'meta_id':23}), # city catalog url(r'^conference/city/$', ConferenceByCity.as_view(), {'meta_id':52}), - url(r'^conference/city/(?P.*)/(?P\d+)/(?P.*)/page/(?P\d+)/$', ConferenceCityCatalog.as_view(), {'meta_id':28}), - url(r'^conference/city/(?P.*)/(?P\d+)/page/(?P\d+)/$', ConferenceCityCatalog.as_view(), {'meta_id':27}), - url(r'^conference/city/(?P.*)/page/(?P\d+)/$', ConferenceCityCatalog.as_view(), {'meta_id':26}), - url(r'^conference/city/(?P.*)/(?P\d+)/(?P.*)/$', ConferenceCityCatalog.as_view(), {'meta_id':28}), - url(r'^conference/city/(?P.*)/(?P\d+)/$', ConferenceCityCatalog.as_view(), {'meta_id':27}), - url(r'^conference/city/(?P.*)/$', ConferenceCityCatalog.as_view(), {'meta_id':26}), + url(r'^conference/city/(?P[^/]*)/(?P\d+)/(?P[^/]*)/page/(?P\d+)/$', ConferenceCityCatalog.as_view(), {'meta_id':28}), + url(r'^conference/city/(?P[^/]*)/(?P\d+)/page/(?P\d+)/$', ConferenceCityCatalog.as_view(), {'meta_id':27}), + url(r'^conference/city/(?P[^/]*)/page/(?P\d+)/$', ConferenceCityCatalog.as_view(), {'meta_id':26}), + url(r'^conference/city/(?P[^/]*)/(?P\d+)/(?P[^/]*)/$', ConferenceCityCatalog.as_view(), {'meta_id':28}), + url(r'^conference/city/(?P[^/]*)/(?P\d+)/$', ConferenceCityCatalog.as_view(), {'meta_id':27}), + url(r'^conference/city/(?P[^/]*)/$', ConferenceCityCatalog.as_view(), {'meta_id':26}), # theme catalog url(r'^conference/theme/$', ConferenceByTheme.as_view(), {'meta_id':50}), - url(r'^conference/theme/(?P.*)/country/(?P.*)/(?P\d+)/(?P.*)/page/(?P\d+)/$', ConferenceThemeCatalog.as_view()), - url(r'^conference/theme/(?P.*)/country/(?P.*)/(?P\d+)/page/(?P\d+)/$', ConferenceThemeCatalog.as_view()), - url(r'^conference/theme/(?P.*)/country/(?P.*)/(?P\d+)/(?P.*)/$', ConferenceThemeCatalog.as_view()), - url(r'^conference/theme/(?P.*)/country/(?P.*)/page/(?P\d+)/$', ConferenceThemeCatalog.as_view()), - url(r'^conference/theme/(?P.*)/country/(?P.*)/(?P\d+)/$', ConferenceThemeCatalog.as_view()), - url(r'^conference/theme/(?P.*)/country/(?P.*)/$', ConferenceThemeCatalog.as_view()), + url(r'^conference/theme/(?P[^/]*)/country/(?P[^/]*)/(?P\d+)/(?P[^/]*)/page/(?P\d+)/$', ConferenceThemeCatalog.as_view()), + url(r'^conference/theme/(?P[^/]*)/country/(?P[^/]*)/(?P\d+)/page/(?P\d+)/$', ConferenceThemeCatalog.as_view()), + url(r'^conference/theme/(?P[^/]*)/country/(?P[^/]*)/(?P\d+)/(?P[^/]*)/$', ConferenceThemeCatalog.as_view()), + url(r'^conference/theme/(?P[^/]*)/country/(?P[^/]*)/page/(?P\d+)/$', ConferenceThemeCatalog.as_view()), + url(r'^conference/theme/(?P[^/]*)/country/(?P[^/]*)/(?P\d+)/$', ConferenceThemeCatalog.as_view()), + url(r'^conference/theme/(?P[^/]*)/country/(?P[^/]*)/$', ConferenceThemeCatalog.as_view()), - url(r'^conference/theme/(?P.*)/city/(?P.*)/(?P\d+)/(?P.*)/page/(?P\d+)/$', ConferenceThemeCatalog.as_view()), - url(r'^conference/theme/(?P.*)/city/(?P.*)/(?P\d+)/(?P.*)/$', ConferenceThemeCatalog.as_view()), - url(r'^conference/theme/(?P.*)/city/(?P.*)/(?P\d+)/page/(?P\d+)/$', ConferenceThemeCatalog.as_view()), - url(r'^conference/theme/(?P.*)/city/(?P.*)/(?P\d+)/$', ConferenceThemeCatalog.as_view()), - url(r'^conference/theme/(?P.*)/city/(?P.*)/page/(?P\d+)/$', ConferenceThemeCatalog.as_view()), + url(r'^conference/theme/(?P[^/]*)/city/(?P[^/]*)/(?P\d+)/(?P[^/]*)/page/(?P\d+)/$', ConferenceThemeCatalog.as_view()), + url(r'^conference/theme/(?P[^/]*)/city/(?P[^/]*)/(?P\d+)/(?P[^/]*)/$', ConferenceThemeCatalog.as_view()), + url(r'^conference/theme/(?P[^/]*)/city/(?P[^/]*)/(?P\d+)/page/(?P\d+)/$', ConferenceThemeCatalog.as_view()), + url(r'^conference/theme/(?P[^/]*)/city/(?P[^/]*)/(?P\d+)/$', ConferenceThemeCatalog.as_view()), + url(r'^conference/theme/(?P[^/]*)/city/(?P[^/]*)/page/(?P\d+)/$', ConferenceThemeCatalog.as_view()), - url(r'^conference/theme/(?P.*)/city/(?P.*)/page/(?P\d+)/$', ConferenceThemeCatalog.as_view()), - url(r'^conference/theme/(?P.*)/city/(?P.*)/$', ConferenceThemeCatalog.as_view()), - url(r'^conference/theme/(?P.*)/(?P\d+)/(?P.*)/page/(?P\d+)/$', ConferenceThemeCatalog.as_view(), {'meta_id':31}), - url(r'^conference/theme/(?P.*)/(?P\d+)/page/(?P\d+)/$', ConferenceThemeCatalog.as_view(), {'meta_id':30}), - url(r'^conference/theme/(?P.*)/page/(?P\d+)/$', ConferenceThemeCatalog.as_view(), {'meta_id':29}), - url(r'^conference/theme/(?P.*)/(?P\d+)/(?P.*)/$', ConferenceThemeCatalog.as_view(), {'meta_id':31}), - url(r'^conference/theme/(?P.*)/(?P\d+)/$', ConferenceThemeCatalog.as_view(), {'meta_id':30}), - url(r'^conference/theme/(?P.*)/$', ConferenceThemeCatalog.as_view(), {'meta_id':29}), + url(r'^conference/theme/(?P[^/]*)/city/(?P[^/]*)/page/(?P\d+)/$', ConferenceThemeCatalog.as_view()), + url(r'^conference/theme/(?P[^/]*)/city/(?P[^/]*)/$', ConferenceThemeCatalog.as_view()), + url(r'^conference/theme/(?P[^/]*)/(?P\d+)/(?P[^/]*)/page/(?P\d+)/$', ConferenceThemeCatalog.as_view(), {'meta_id':31}), + url(r'^conference/theme/(?P[^/]*)/(?P\d+)/page/(?P\d+)/$', ConferenceThemeCatalog.as_view(), {'meta_id':30}), + url(r'^conference/theme/(?P[^/]*)/page/(?P\d+)/$', ConferenceThemeCatalog.as_view(), {'meta_id':29}), + url(r'^conference/theme/(?P[^/]*)/(?P\d+)/(?P[^/]*)/$', ConferenceThemeCatalog.as_view(), {'meta_id':31}), + url(r'^conference/theme/(?P[^/]*)/(?P\d+)/$', ConferenceThemeCatalog.as_view(), {'meta_id':30}), + url(r'^conference/theme/(?P[^/]*)/$', ConferenceThemeCatalog.as_view(), {'meta_id':29}), # tag catalog url(r'^conference/tag/$', ConferenceByTag.as_view(), {'meta_id':50}), - url(r'^conference/tag/(?P.*)/(?P\d+)/(?P.*)/page/(?P\d+)/$', ConferenceTagCatalog.as_view(), {'meta_id':34}), - url(r'^conference/tag/(?P.*)/(?P\d+)/page/(?P\d+)/$', ConferenceTagCatalog.as_view(), {'meta_id':33}), - url(r'^conference/tag/(?P.*)/page/(?P\d+)/$', ConferenceTagCatalog.as_view(), {'meta_id':32}), - url(r'^conference/tag/(?P.*)/(?P\d+)/(?P.*)/$', ConferenceTagCatalog.as_view(), {'meta_id':34}), - url(r'^conference/tag/(?P.*)/(?P\d+)/$', ConferenceTagCatalog.as_view(), {'meta_id':33}), - url(r'^conference/tag/(?P.*)/$', ConferenceTagCatalog.as_view(), {'meta_id':32}), + url(r'^conference/tag/(?P[^/]*)/(?P\d+)/(?P[^/]*)/page/(?P\d+)/$', ConferenceTagCatalog.as_view(), {'meta_id':34}), + url(r'^conference/tag/(?P[^/]*)/(?P\d+)/page/(?P\d+)/$', ConferenceTagCatalog.as_view(), {'meta_id':33}), + url(r'^conference/tag/(?P[^/]*)/page/(?P\d+)/$', ConferenceTagCatalog.as_view(), {'meta_id':32}), + url(r'^conference/tag/(?P[^/]*)/(?P\d+)/(?P[^/]*)/$', ConferenceTagCatalog.as_view(), {'meta_id':34}), + url(r'^conference/tag/(?P[^/]*)/(?P\d+)/$', ConferenceTagCatalog.as_view(), {'meta_id':33}), + url(r'^conference/tag/(?P[^/]*)/$', ConferenceTagCatalog.as_view(), {'meta_id':32}), # conf additional pages - url(r'^conference/(?P.*)/send_to_organiser/$', 'conference.views.send_to_organiser'), - url(r'^conference/(?P.*)/photo/page/(?P\d+)/$', ConferencePhotoView.as_view(), {'meta_id': 93}), - url(r'^conference/(?P.*)/photo/$', ConferencePhotoView.as_view(), {'meta_id': 93}), - url(r'^conference/(?P.*)/visitors/page/(?P\d+)/$', ConferenceVisitors.as_view()), - url(r'^conference/(?P.*)/visitors/$', ConferenceVisitors.as_view()), - url(r'^conference/(?P.*)/members/page/(?P\d+)/$', ConferenceMembers.as_view()), - url(r'^conference/(?P.*)/members/$', ConferenceMembers.as_view()), - url(r'^conference/(?P.*)/service/thanks/', ConferenceThankView.as_view()), - url(r'^conference/(?P.*)/service/visit/', 'conference.views.visit_redirect'), + url(r'^conference/(?P[^/]*)/send_to_organiser/$', 'conference.views.send_to_organiser'), + url(r'^conference/(?P[^/]*)/photo/page/(?P\d+)/$', ConferencePhotoView.as_view(), {'meta_id': 93}), + url(r'^conference/(?P[^/]*)/photo/$', ConferencePhotoView.as_view(), {'meta_id': 93}), + url(r'^conference/(?P[^/]*)/visitors/page/(?P\d+)/$', ConferenceVisitors.as_view()), + url(r'^conference/(?P[^/]*)/visitors/$', ConferenceVisitors.as_view()), + url(r'^conference/(?P[^/]*)/members/page/(?P\d+)/$', ConferenceMembers.as_view()), + url(r'^conference/(?P[^/]*)/members/$', ConferenceMembers.as_view()), + url(r'^conference/(?P[^/]*)/service/thanks/', ConferenceThankView.as_view()), + url(r'^conference/(?P[^/]*)/service/visit/', 'conference.views.visit_redirect'), - url(r'^conference/(?P.*)/service/(?P.*)/', ConferenceServiceView.as_view()), + url(r'^conference/(?P[^/]*)/service/(?P[^/]*)/', ConferenceServiceView.as_view()), # conf list - url(r'^conference/(?P\d+)/(?P.*)/page/(?P\d+)/$', ConferenceList.as_view(), {'meta_id':22}), + url(r'^conference/(?P\d+)/(?P[^/]*)/page/(?P\d+)/$', ConferenceList.as_view(), {'meta_id':22}), url(r'^conference/(?P\d+)/page/(?P\d+)/$', ConferenceList.as_view(), {'meta_id':21}), - url(r'^conference/(?P\d+)/(?P.*)/$', ConferenceList.as_view(), {'meta_id':22}), + url(r'^conference/(?P\d+)/(?P[^/]*)/$', ConferenceList.as_view(), {'meta_id':22}), url(r'^conference/(?P\d+)/$', ConferenceList.as_view(), {'meta_id':21}), url(r'^conference/page/(?P\d+)/$', ConferenceList.as_view(), {'meta_id':20}), # conf page - url(r'^conference/(?P.*)/$', ConferenceDetail.as_view(), {'meta_id':35}), + url(r'^conference/(?P[^/]*)/$', ConferenceDetail.as_view(), {'meta_id':35}), url(r'^conference/$', ConferenceList.as_view(), {'meta_id':20}), ) diff --git a/exposition/urls.py b/exposition/urls.py index 8a0cd940..fdf29e00 100644 --- a/exposition/urls.py +++ b/exposition/urls.py @@ -32,65 +32,65 @@ urlpatterns = patterns('', # country catalog url(r'^expo/country/$', ExpositionByCountry.as_view(), {'meta_id':54}), - url(r'^expo/country/(?P.*)/(?P\d+)/(?P.*)/page/(?P\d+)/$', ExpoCountryCatalog.as_view(), {'meta_id':7}), - url(r'^expo/country/(?P.*)/(?P\d+)/page/(?P\d+)/$', ExpoCountryCatalog.as_view(), {'meta_id':6}), - url(r'^expo/country/(?P.*)/page/(?P\d+)/$', ExpoCountryCatalog.as_view(), {'meta_id':5}), - url(r'^expo/country/(?P.*)/(?P\d+)/(?P.*)/$', ExpoCountryCatalog.as_view(), {'meta_id':7}), - url(r'^expo/country/(?P.*)/(?P\d+)/$', ExpoCountryCatalog.as_view(), {'meta_id':6}), - url(r'^expo/country/(?P.*)/$', ExpoCountryCatalog.as_view(), {'meta_id':5}), + url(r'^expo/country/(?P[^/]*)/(?P\d+)/(?P[^/]*)/page/(?P\d+)/$', ExpoCountryCatalog.as_view(), {'meta_id':7}), + url(r'^expo/country/(?P[^/]*)/(?P\d+)/page/(?P\d+)/$', ExpoCountryCatalog.as_view(), {'meta_id':6}), + url(r'^expo/country/(?P[^/]*)/page/(?P\d+)/$', ExpoCountryCatalog.as_view(), {'meta_id':5}), + url(r'^expo/country/(?P[^/]*)/(?P\d+)/(?P[^/]*)/$', ExpoCountryCatalog.as_view(), {'meta_id':7}), + url(r'^expo/country/(?P[^/]*)/(?P\d+)/$', ExpoCountryCatalog.as_view(), {'meta_id':6}), + url(r'^expo/country/(?P[^/]*)/$', ExpoCountryCatalog.as_view(), {'meta_id':5}), # city catalog url(r'^expo/city/$', ExpositionByCity.as_view(), {'meta_id':53}), - url(r'^expo/city/(?P.*)/(?P\d+)/(?P.*)/page/(?P\d+)/$', ExpoCityCatalog.as_view(), {'meta_id':10}), - url(r'^expo/city/(?P.*)/(?P\d+)/page/(?P\d+)/$', ExpoCityCatalog.as_view(), {'meta_id':9}), - url(r'^expo/city/(?P.*)/page/(?P\d+)/$', ExpoCityCatalog.as_view(), {'meta_id':8}), - url(r'^expo/city/(?P.*)/(?P\d+)/(?P.*)/$', ExpoCityCatalog.as_view(), {'meta_id':10}), - url(r'^expo/city/(?P.*)/(?P\d+)/$', ExpoCityCatalog.as_view(), {'meta_id':9}), - url(r'^expo/city/(?P.*)/$', ExpoCityCatalog.as_view(), {'meta_id':8}), + url(r'^expo/city/(?P[^/]*)/(?P\d+)/(?P[^/]*)/page/(?P\d+)/$', ExpoCityCatalog.as_view(), {'meta_id':10}), + url(r'^expo/city/(?P[^/]*)/(?P\d+)/page/(?P\d+)/$', ExpoCityCatalog.as_view(), {'meta_id':9}), + url(r'^expo/city/(?P[^/]*)/page/(?P\d+)/$', ExpoCityCatalog.as_view(), {'meta_id':8}), + url(r'^expo/city/(?P[^/]*)/(?P\d+)/(?P[^/]*)/$', ExpoCityCatalog.as_view(), {'meta_id':10}), + url(r'^expo/city/(?P[^/]*)/(?P\d+)/$', ExpoCityCatalog.as_view(), {'meta_id':9}), + url(r'^expo/city/(?P[^/]*)/$', ExpoCityCatalog.as_view(), {'meta_id':8}), # theme catalog url(r'^expo/theme/$', ExpositionByTheme.as_view(), {'meta_id':55}), - url(r'^expo/theme/(?P.*)/country/(?P.*)/(?P\d+)/(?P.*)/page/(?P\d+)/$', ExpoThemeCatalog.as_view(), {'meta_id':44}), - url(r'^expo/theme/(?P.*)/country/(?P.*)/(?P\d+)/page/(?P\d+)/$', ExpoThemeCatalog.as_view(), {'meta_id':44}), - url(r'^expo/theme/(?P.*)/country/(?P.*)/(?P\d+)/(?P.*)/$', ExpoThemeCatalog.as_view(), {'meta_id':44}), - url(r'^expo/theme/(?P.*)/country/(?P.*)/page/(?P\d+)/$', ExpoThemeCatalog.as_view(), {'meta_id':44}), - url(r'^expo/theme/(?P.*)/country/(?P.*)/(?P\d+)/$', ExpoThemeCatalog.as_view(), {'meta_id':44}), - url(r'^expo/theme/(?P.*)/country/(?P.*)/$', ExpoThemeCatalog.as_view(), {'meta_id':44}), + url(r'^expo/theme/(?P[^/]*)/country/(?P[^/]*)/(?P\d+)/(?P[^/]*)/page/(?P\d+)/$', ExpoThemeCatalog.as_view(), {'meta_id':44}), + url(r'^expo/theme/(?P[^/]*)/country/(?P[^/]*)/(?P\d+)/page/(?P\d+)/$', ExpoThemeCatalog.as_view(), {'meta_id':44}), + url(r'^expo/theme/(?P[^/]*)/country/(?P[^/]*)/(?P\d+)/(?P[^/]*)/$', ExpoThemeCatalog.as_view(), {'meta_id':44}), + url(r'^expo/theme/(?P[^/]*)/country/(?P[^/]*)/page/(?P\d+)/$', ExpoThemeCatalog.as_view(), {'meta_id':44}), + url(r'^expo/theme/(?P[^/]*)/country/(?P[^/]*)/(?P\d+)/$', ExpoThemeCatalog.as_view(), {'meta_id':44}), + url(r'^expo/theme/(?P[^/]*)/country/(?P[^/]*)/$', ExpoThemeCatalog.as_view(), {'meta_id':44}), - url(r'^expo/theme/(?P.*)/city/(?P.*)/(?P\d+)/(?P.*)/page/(?P\d+)/$', ExpoThemeCatalog.as_view(), {'meta_id':42}), - url(r'^expo/theme/(?P.*)/city/(?P.*)/(?P\d+)/(?P.*)/$', ExpoThemeCatalog.as_view(), {'meta_id':42}), - url(r'^expo/theme/(?P.*)/city/(?P.*)/(?P\d+)/page/(?P\d+)/$', ExpoThemeCatalog.as_view(), {'meta_id':42}), - url(r'^expo/theme/(?P.*)/city/(?P.*)/(?P\d+)/$', ExpoThemeCatalog.as_view(), {'meta_id':42}), + url(r'^expo/theme/(?P[^/]*)/city/(?P[^/]*)/(?P\d+)/(?P[^/]*)/page/(?P\d+)/$', ExpoThemeCatalog.as_view(), {'meta_id':42}), + url(r'^expo/theme/(?P[^/]*)/city/(?P[^/]*)/(?P\d+)/(?P[^/]*)/$', ExpoThemeCatalog.as_view(), {'meta_id':42}), + url(r'^expo/theme/(?P[^/]*)/city/(?P[^/]*)/(?P\d+)/page/(?P\d+)/$', ExpoThemeCatalog.as_view(), {'meta_id':42}), + url(r'^expo/theme/(?P[^/]*)/city/(?P[^/]*)/(?P\d+)/$', ExpoThemeCatalog.as_view(), {'meta_id':42}), + url(r'^expo/theme/(?P[^/]*)/city/(?P[^/]*)/page/(?P\d+)/$', ExpoThemeCatalog.as_view(), {'meta_id':42}), + url(r'^expo/theme/(?P[^/]*)/city/(?P[^/]*)/$', ExpoThemeCatalog.as_view(), {'meta_id':42}), - url(r'^expo/theme/(?P.*)/city/(?P.*)/page/(?P\d+)/$', ExpoThemeCatalog.as_view(), {'meta_id':42}), - url(r'^expo/theme/(?P.*)/city/(?P.*)/$', ExpoThemeCatalog.as_view(), {'meta_id':42}), - url(r'^expo/theme/(?P.*)/(?P\d+)/(?P.*)/page/(?P\d+)/$', ExpoThemeCatalog.as_view(), {'meta_id':13}), - url(r'^expo/theme/(?P.*)/(?P\d+)/page/(?P\d+)/$', ExpoThemeCatalog.as_view(), {'meta_id':12}), - url(r'^expo/theme/(?P.*)/page/(?P\d+)/$', ExpoThemeCatalog.as_view(), {'meta_id':11}), - url(r'^expo/theme/(?P.*)/(?P\d+)/(?P.*)/$', ExpoThemeCatalog.as_view(), {'meta_id':13}), - url(r'^expo/theme/(?P.*)/(?P\d+)/$', ExpoThemeCatalog.as_view(), {'meta_id':12}), - url(r'^expo/theme/(?P.*)/$', ExpoThemeCatalog.as_view(), {'meta_id':11}), + url(r'^expo/theme/(?P[^/]*)/(?P\d+)/(?P[^/]*)/page/(?P\d+)/$', ExpoThemeCatalog.as_view(), {'meta_id':13}), + url(r'^expo/theme/(?P[^/]*)/(?P\d+)/page/(?P\d+)/$', ExpoThemeCatalog.as_view(), {'meta_id':12}), + url(r'^expo/theme/(?P[^/]*)/page/(?P\d+)/$', ExpoThemeCatalog.as_view(), {'meta_id':11}), + url(r'^expo/theme/(?P[^/]*)/(?P\d+)/(?P[^/]*)/$', ExpoThemeCatalog.as_view(), {'meta_id':13}), + url(r'^expo/theme/(?P[^/]*)/(?P\d+)/$', ExpoThemeCatalog.as_view(), {'meta_id':12}), + url(r'^expo/theme/(?P[^/]*)/$', ExpoThemeCatalog.as_view(), {'meta_id':11}), # tag catalog - url(r'^expo/tag/(?P.*)/(?P\d+)/(?P.*)/page/(?P\d+)/$', ExpoTagCatalog.as_view(), {'meta_id':17}), - url(r'^expo/tag/(?P.*)/(?P\d+)/page/(?P\d+)/$', ExpoTagCatalog.as_view(), {'meta_id':15}), - url(r'^expo/tag/(?P.*)/page/(?P\d+)/$', ExpoTagCatalog.as_view(), {'meta_id':14}), - url(r'^expo/tag/(?P.*)/(?P\d+)/(?P.*)/$', ExpoTagCatalog.as_view(), {'meta_id':17}), - url(r'^expo/tag/(?P.*)/(?P\d+)/$', ExpoTagCatalog.as_view(), {'meta_id':15}), - url(r'^expo/tag/(?P.*)/$', ExpoTagCatalog.as_view(), {'meta_id':14}), + url(r'^expo/tag/(?P[^/]*)/(?P\d+)/(?P[^/]*)/page/(?P\d+)/$', ExpoTagCatalog.as_view(), {'meta_id':17}), + url(r'^expo/tag/(?P[^/]*)/(?P\d+)/page/(?P\d+)/$', ExpoTagCatalog.as_view(), {'meta_id':15}), + url(r'^expo/tag/(?P[^/]*)/page/(?P\d+)/$', ExpoTagCatalog.as_view(), {'meta_id':14}), + url(r'^expo/tag/(?P[^/]*)/(?P\d+)/(?P[^/]*)/$', ExpoTagCatalog.as_view(), {'meta_id':17}), + url(r'^expo/tag/(?P[^/]*)/(?P\d+)/$', ExpoTagCatalog.as_view(), {'meta_id':15}), + url(r'^expo/tag/(?P[^/]*)/$', ExpoTagCatalog.as_view(), {'meta_id':14}), # expo additional pages - url(r'^expo/(?P.*)/send_to_organiser/$', 'exposition.views.send_to_organiser'), - url(r'^expo/(?P.*)/statistic/$', ExpositionStatistic.as_view(), {'meta_id':60}), - url(r'^expo/(?P.*)/price/$', ExpositionPrice.as_view(), {'meta_id':61}), - url(r'^expo/(?P.*)/program/$', ExpositionProgramme.as_view(), {'meta_id':62}), - url(r'^expo/(?P.*)/visitors/page/(?P\d+)/$', ExpoVisitors.as_view(), {'meta_id':64}), - url(r'^expo/(?P.*)/visitors/$', ExpoVisitors.as_view(), {'meta_id':64}), - url(r'^expo/(?P.*)/photo/page/(?P\d+)/$', ExpoPhotoView.as_view(), {'meta_id': 92}), - url(r'^expo/(?P.*)/photo/$', ExpoPhotoView.as_view(), {'meta_id': 92}), - url(r'^expo/(?P.*)/members/page/(?P\d+)/$', ExpoMembers.as_view(), {'meta_id':63}), - url(r'^expo/(?P.*)/members/$', ExpoMembers.as_view(), {'meta_id':63}), - url(r'^expo/(?P.*)/service/thanks/', ExpositionThankView.as_view()), - url(r'^expo/(?P.*)/service/visit/', 'exposition.views.visit_redirect'), - url(r'^expo/(?P.*)/service/(?P.*)/', ExpositionServiceView.as_view()), + url(r'^expo/(?P[^/]*)/send_to_organiser/$', 'exposition.views.send_to_organiser'), + url(r'^expo/(?P[^/]*)/statistic/$', ExpositionStatistic.as_view(), {'meta_id':60}), + url(r'^expo/(?P[^/]*)/price/$', ExpositionPrice.as_view(), {'meta_id':61}), + url(r'^expo/(?P[^/]*)/program/$', ExpositionProgramme.as_view(), {'meta_id':62}), + url(r'^expo/(?P[^/]*)/visitors/page/(?P\d+)/$', ExpoVisitors.as_view(), {'meta_id':64}), + url(r'^expo/(?P[^/]*)/visitors/$', ExpoVisitors.as_view(), {'meta_id':64}), + url(r'^expo/(?P[^/]*)/photo/page/(?P\d+)/$', ExpoPhotoView.as_view(), {'meta_id': 92}), + url(r'^expo/(?P[^/]*)/photo/$', ExpoPhotoView.as_view(), {'meta_id': 92}), + url(r'^expo/(?P[^/]*)/members/page/(?P\d+)/$', ExpoMembers.as_view(), {'meta_id':63}), + url(r'^expo/(?P[^/]*)/members/$', ExpoMembers.as_view(), {'meta_id':63}), + url(r'^expo/(?P[^/]*)/service/thanks/', ExpositionThankView.as_view()), + url(r'^expo/(?P[^/]*)/service/visit/', 'exposition.views.visit_redirect'), + url(r'^expo/(?P[^/]*)/service/(?P[^/]*)/', ExpositionServiceView.as_view()), # expo list - url(r'^expo/(?P\d+)/(?P.*)/page/(?P\d+)/$', ExpoList.as_view(), {'meta_id':4}), + url(r'^expo/(?P\d+)/(?P[^/]*)/page/(?P\d+)/$', ExpoList.as_view(), {'meta_id':4}), url(r'^expo/(?P\d+)/page/(?P\d+)/$', ExpoList.as_view(), {'meta_id':3}), url(r'^expo/(?P\d+)/(?P.*)/$', ExpoList.as_view(), {'meta_id':4}), url(r'^expo/(?P\d+)/$', ExpoList.as_view(), {'meta_id':3}), diff --git a/meta/models.py b/meta/models.py index c0002aa1..9643ad96 100644 --- a/meta/models.py +++ b/meta/models.py @@ -150,14 +150,12 @@ class SeoTextManager(TranslationManager): url = kwargs.get('url') lang = kwargs.get('lang')[:2] or translation.get_language()[:2] key = 'seo_text_cache' - if key in cache: - result = cache.get(key) - return result.get("%s_%s" % (lang, url)) - else: + result = cache.get(key) + if result is None: qs = list(SeoText.objects.language('all')) - value_dict = {obj.language_code+'_'+obj.url: obj for obj in qs} - cache.set(key, value_dict, self.cache_time) - return value_dict.get("%s_%s" % (lang, url)) + result = {obj.language_code+'_'+obj.url: obj for obj in qs} + cache.set(key, result, self.cache_time) + return result.get("%s_%s" % (lang, url), None) class SeoText(TranslatableModel): diff --git a/templates/client/article/news.html b/templates/client/article/news.html index 5a26e8f3..c638478a 100644 --- a/templates/client/article/news.html +++ b/templates/client/article/news.html @@ -55,7 +55,7 @@
- +
{% for news in object.similar %}
diff --git a/templates/client/includes/place/place_object.html b/templates/client/includes/place/place_object.html index cdd69757..0ace3dce 100644 --- a/templates/client/includes/place/place_object.html +++ b/templates/client/includes/place/place_object.html @@ -206,8 +206,8 @@
{{ pl.total_area }}
{% endif %}
@@ -238,4 +238,4 @@ } }); -{% endblock %} \ No newline at end of file +{% endblock %}