X-Git-Url: http://gitweb.fperrin.net/?p=djsite.git;a=blobdiff_plain;f=quotes%2Fviews.py;h=bd7f6f605bb142cd44ad196368fa252162dd421c;hp=981af054515b7817efb40daae2138b7d34de0b1a;hb=13c2e4fc8a5506cfa074c06335a73d28a173aba9;hpb=471c53df73726601ffdbefc3f709ab5b6cb381ff diff --git a/quotes/views.py b/quotes/views.py index 981af05..bd7f6f6 100644 --- a/quotes/views.py +++ b/quotes/views.py @@ -4,7 +4,7 @@ from django.template import loader from random import randint -from .models import Author, Quote, Tag +from .models import Author, Work, Quote, Tag # Create your views here. def onequote(request, quote_id): @@ -26,6 +26,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 }