]> gitweb.fperrin.net Git - djsite.git/blobdiff - quotes/views.py
Use django-tagging for tags
[djsite.git] / quotes / views.py
index 981af054515b7817efb40daae2138b7d34de0b1a..002c4e34a6b8ada081f5ffcd0ffab4663c204d7a 100644 (file)
@@ -1,10 +1,8 @@
 from django.shortcuts import render
-from django.http import HttpResponse
-from django.template import loader
 
 from random import randint
 
-from .models import Author, Quote, Tag
+from .models import Author, Work, Quote
 
 # Create your views here.
 def onequote(request, quote_id):
@@ -26,6 +24,11 @@ def author(request, author_id):
     context = { 'author' : author }
     return render(request, 'quotes/author.html', context)
 
+def work(request, work_id):
+    work = Work.objects.get(id=work_id)
+    context = { 'work': work }
+    return render(request, 'quotes/work.html', context)
+
 def all(request):
     quotes = Quote.objects.all()
     context = { 'quotes' : quotes }