From bc9e7257ad83e8d3bb71da0b8cac97ea6dc348aa Mon Sep 17 00:00:00 2001 From: luxagraf Date: Sun, 7 May 2023 09:29:45 -0400 Subject: posts: added films to build scripts and jrnl RSS --- app/posts/build.py | 13 +++++++++++++ app/posts/views/jrnl_views.py | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) (limited to 'app/posts') diff --git a/app/posts/build.py b/app/posts/build.py index b49b925..7f5dc7b 100644 --- a/app/posts/build.py +++ b/app/posts/build.py @@ -150,3 +150,16 @@ class BuildFriends(BuildNew): ) self.build_detail_view() self.build_feed("friends:feed") + + +class BuildFilms(BuildNew): + + def get_model_queryset(self): + return self.model.objects.filter(post_type=PostType.FILM).filter(status__exact=1).order_by('-pub_date') + + def build(self): + self.build_list_view( + base_path=reverse("films:list"), + paginate_by=30 + ) + self.build_detail_view() diff --git a/app/posts/views/jrnl_views.py b/app/posts/views/jrnl_views.py index 6692b0f..bb50f6f 100644 --- a/app/posts/views/jrnl_views.py +++ b/app/posts/views/jrnl_views.py @@ -142,7 +142,7 @@ class JrnlRSSFeedView(Feed): description_template = 'feeds/blog_description.html' def items(self): - return Post.objects.filter(status__exact=1).filter(post_type=PostType.JRNL).order_by('-pub_date')[:10] + return Post.objects.filter(status__exact=1).filter(post_type__in=[PostType.JRNL,PostType.FILM]).order_by('-pub_date')[:10] def item_pubdate(self, item): """ -- cgit v1.2.3-70-g09d2