diff options
Diffstat (limited to 'app/unused_apps/fieldnotes/views.py')
-rw-r--r-- | app/unused_apps/fieldnotes/views.py | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/app/unused_apps/fieldnotes/views.py b/app/unused_apps/fieldnotes/views.py new file mode 100644 index 0000000..9b49cc0 --- /dev/null +++ b/app/unused_apps/fieldnotes/views.py @@ -0,0 +1,37 @@ +from django.views.generic.dates import YearArchiveView, MonthArchiveView +from django.views.generic.detail import DetailView + +from utils.views import PaginatedListView, LuxDetailView + +from .models import FieldNote + + +class FieldNoteListView(PaginatedListView): + model = FieldNote + """ + Return a list of Notes in reverse chronological order + """ + queryset = FieldNote.objects.filter(status=1).order_by('-pub_date') + + +class FieldNoteDetailView(LuxDetailView): + model = FieldNote + slug_field = "slug" + + +class FieldNoteDetailViewTXT(FieldNoteDetailView): + template_name = "jrnl/entry.txt" + + +class FieldNoteYearArchiveView(YearArchiveView): + queryset = FieldNote.objects.filter(status=1) + date_field = "pub_date" + template_name = "fieldnotes/fieldnote_archive_list_date.html" + make_object_list = True + + +class FieldNoteMonthArchiveView(MonthArchiveView): + queryset = FieldNote.objects.filter(status=1) + date_field = "pub_date" + make_object_list = True + template_name = "fieldnotes/fieldnote_archive_list_date.html" |