Skip to content
This repository has been archived by the owner on Oct 29, 2019. It is now read-only.

Commit

Permalink
Slight adjustments on view mixins.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kirill Kniazev committed Dec 25, 2015
1 parent 4188216 commit bca1ad8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
14 changes: 8 additions & 6 deletions aldryn_newsblog/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,16 @@ def dispatch(self, request, *args, **kwargs):

def get_queryset(self):
# filter available objects to contain only resolvable for current
# language
# language. IMPORTANT: after .translated - we cannot use .filter
# on translated fields (parler/django limitation).
# if your mixin contains filtering after super call - please place it
# after this mixin.
qs = super(AppHookCheckMixin, self).get_queryset()
return qs.translated(*self.valid_languages)


class ArticleDetail(PreviewModeMixin, TranslatableSlugMixin, AppConfigMixin,
AppHookCheckMixin, TemplatePrefixMixin, DetailView):
class ArticleDetail(AppConfigMixin, AppHookCheckMixin, PreviewModeMixin,
TranslatableSlugMixin, TemplatePrefixMixin, DetailView):
model = Article
slug_field = 'slug'
year_url_kwarg = 'year'
Expand Down Expand Up @@ -190,9 +193,8 @@ def get_next_object(self, queryset=None, object=None):
return None


class ArticleListBase(
TemplatePrefixMixin, PreviewModeMixin,
ViewUrlMixin, AppConfigMixin, AppHookCheckMixin, ListView):
class ArticleListBase(AppConfigMixin, AppHookCheckMixin, TemplatePrefixMixin,
PreviewModeMixin, ViewUrlMixin, ListView):
model = Article
show_header = False

Expand Down
2 changes: 1 addition & 1 deletion test
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash

djangocms-helper aldryn_newsblog --cms test --extra-settings=test_settings $@
djangocms-helper aldryn_newsblog --cms test --boilerplate --extra-settings=test_settings $@

0 comments on commit bca1ad8

Please sign in to comment.