forked from rc/aircox
Feat: packaging (#127)
- Add configuration files for packaging - Precommit now uses ruff Co-authored-by: bkfox <thomas bkfox net> Reviewed-on: rc/aircox#127
This commit is contained in:
@@ -32,13 +32,7 @@ class BasePageListView(AttachedToMixin, ParentMixin, BaseView, ListView):
|
||||
return super().get(*args, **kwargs)
|
||||
|
||||
def get_queryset(self):
|
||||
return (
|
||||
super()
|
||||
.get_queryset()
|
||||
.select_subclasses()
|
||||
.published()
|
||||
.select_related("cover")
|
||||
)
|
||||
return super().get_queryset().select_subclasses().published().select_related("cover")
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
kwargs.setdefault("item_template_name", self.item_template_name)
|
||||
@@ -97,12 +91,7 @@ class PageListView(FiltersMixin, BasePageListView):
|
||||
return super().get_filterset(data, query)
|
||||
|
||||
def get_queryset(self):
|
||||
qs = (
|
||||
super()
|
||||
.get_queryset()
|
||||
.select_related("category")
|
||||
.order_by("-pub_date")
|
||||
)
|
||||
qs = super().get_queryset().select_related("category").order_by("-pub_date")
|
||||
return qs
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
@@ -131,9 +120,7 @@ class PageDetailView(BasePageDetailView):
|
||||
def get_context_data(self, **kwargs):
|
||||
if self.object.allow_comments and "comment_form" not in kwargs:
|
||||
kwargs["comment_form"] = CommentForm()
|
||||
kwargs["comments"] = Comment.objects.filter(page=self.object).order_by(
|
||||
"-date"
|
||||
)
|
||||
kwargs["comments"] = Comment.objects.filter(page=self.object).order_by("-date")
|
||||
return super().get_context_data(**kwargs)
|
||||
|
||||
@classmethod
|
||||
|
||||
Reference in New Issue
Block a user