summaryrefslogtreecommitdiff
path: root/app/posts/views/field_note_views.py
diff options
context:
space:
mode:
Diffstat (limited to 'app/posts/views/field_note_views.py')
-rw-r--r--app/posts/views/field_note_views.py39
1 files changed, 39 insertions, 0 deletions
diff --git a/app/posts/views/field_note_views.py b/app/posts/views/field_note_views.py
new file mode 100644
index 0000000..41ceeaa
--- /dev/null
+++ b/app/posts/views/field_note_views.py
@@ -0,0 +1,39 @@
+from django.views.generic.dates import YearArchiveView, MonthArchiveView
+from django.views.generic.detail import DetailView
+
+from utils.views import PaginatedListView, LuxDetailView
+
+from ..models import Post, PostType
+
+
+class FieldNoteListView(PaginatedListView):
+ model = Post
+ template_name = "posts/fieldnote_list.html"
+ """
+ Return a list of Notes in reverse chronological order
+ """
+ queryset = Post.objects.filter(post_type=PostType.FIELD_NOTE,status=1).order_by('-pub_date')
+
+
+class FieldNoteDetailView(LuxDetailView):
+ model = Post
+ slug_field = "slug"
+ template_name = "posts/fieldnote_detail.html"
+
+
+class FieldNoteDetailViewTXT(FieldNoteDetailView):
+ template_name = "posts/entry_detail.txt"
+
+
+class FieldNoteYearArchiveView(YearArchiveView):
+ queryset = Post.objects.filter(post_type=PostType.FIELD_NOTE,status=1)
+ date_field = "pub_date"
+ template_name = "posts/fieldnote_archive_list_date.html"
+ make_object_list = True
+
+
+class FieldNoteMonthArchiveView(MonthArchiveView):
+ queryset = Post.objects.filter(post_type=PostType.FIELD_NOTE,status=1)
+ date_field = "pub_date"
+ make_object_list = True
+ template_name = "posts/fieldnote_archive_list_date.html"