From fdb951576ff642d160bd66cba82179fa2ca247d7 Mon Sep 17 00:00:00 2001 From: luxagraf Date: Mon, 8 Feb 2016 12:53:07 -0500 Subject: redid notes to make them self-contained and local --- app/notes/views.py | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) (limited to 'app/notes/views.py') diff --git a/app/notes/views.py b/app/notes/views.py index e89087e..b8bc04e 100644 --- a/app/notes/views.py +++ b/app/notes/views.py @@ -1,6 +1,37 @@ from django.shortcuts import render_to_response, get_object_or_404 from django.template import RequestContext -from notes.models import Note +from django.views.generic.detail import DetailView + +from utils.views import PaginatedListView + +from notes.models import LuxNote, Note + + +class NoteList(PaginatedListView): + """ + Return a list of Notes in reverse chronological order + """ + queryset = LuxNote.objects.all().order_by('-pub_date') + template_name = "archives/notes.html" + + +class NoteDetailView(DetailView): + model = LuxNote + template_name = "details/note.html" + slug_field = "slug" + + +class NoteDetailViewTXT(NoteDetailView): + template_name = "details/entry.txt" + + +class NoteDetailViewAMP(NoteDetailView): + template_name = "details/entry.amp" + + +""" +Legacy Notes views +""" def entry_detail(request, year, month, slug): -- cgit v1.2.3-70-g09d2