diff options
author | luxagraf <sng@luxagraf.net> | 2016-02-08 12:53:07 -0500 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2016-02-08 12:53:07 -0500 |
commit | fdb951576ff642d160bd66cba82179fa2ca247d7 (patch) | |
tree | d9889ac6951f48f475ee88718da8e7f4afb8a345 /app/notes/views.py | |
parent | 34df0f81d9a4480eb33c77a22879218e35fa0b49 (diff) |
redid notes to make them self-contained and local
Diffstat (limited to 'app/notes/views.py')
-rw-r--r-- | app/notes/views.py | 33 |
1 files changed, 32 insertions, 1 deletions
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): |