summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorluxagraf <sng@luxagraf.net>2023-05-07 09:29:45 -0400
committerluxagraf <sng@luxagraf.net>2023-05-07 09:29:45 -0400
commitbc9e7257ad83e8d3bb71da0b8cac97ea6dc348aa (patch)
tree0383f4a5a82d9dc1418c46a33efa3f63d7ffac48
parent1dde8abfac7a8f84f5ff30d424e417f5d6f0b273 (diff)
posts: added films to build scripts and jrnl RSS
-rw-r--r--app/builder/views.py5
-rw-r--r--app/posts/build.py13
-rw-r--r--app/posts/views/jrnl_views.py2
-rw-r--r--templates/admin/index.html2
4 files changed, 19 insertions, 3 deletions
diff --git a/app/builder/views.py b/app/builder/views.py
index 296b9e6..85e7226 100644
--- a/app/builder/views.py
+++ b/app/builder/views.py
@@ -6,7 +6,7 @@ from resume.build import pub_builder, resume_builder
from books.build import builder as book_builder
from sightings.build import builder as sightings_builder
from pages.build import BuildPages, BuildHome
-from posts.build import BuildJrnl, BuildFieldNotes, BuildSrc, BuildGuide, BuildEssays, BuildRange, BuildFriends
+from posts.build import BuildJrnl, BuildFieldNotes, BuildSrc, BuildGuide, BuildEssays, BuildRange, BuildFriends, BuildFilms
def do_build(request):
section = request.GET.get('id', '')
@@ -25,6 +25,9 @@ def do_build(request):
elif section == 'homepage':
context = {'message': 'Writing index to Disk'}
BuildHome("pages", "homepage").build()
+ elif section == 'films':
+ context = {'message': 'Writing films to Disk'}
+ BuildFilms("posts", "post").build()
elif section == 'essays':
context = {'message': 'Writing essays to Disk'}
BuildEssays("posts", "post").build()
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):
"""
diff --git a/templates/admin/index.html b/templates/admin/index.html
index 78ada5b..e2285f8 100644
--- a/templates/admin/index.html
+++ b/templates/admin/index.html
@@ -90,7 +90,7 @@ td, th {
<tr>
<th scope="row"><a href="/admin/locations/location/">locations</a></th>
<td><a href="/admin/locations/location/add/" class="addlink">Add</a></td>
- <td><a href="/admin/build/build?id=friends">Build Friends</a></td>
+ <td><a href="/admin/build/build?id=films">Build Films</a></td>
</tr>
<tr>
<th scope="row"><a href="/admin/sightings/ap/">dialogue</a></th>