X-Git-Url: http://gitweb.fperrin.net/?a=blobdiff_plain;f=quotes%2Fviews.py;h=01cb4e33f5ced7d73efac3edfd0ae303d26b604f;hb=5be623b47010e85eddcfa152f606822231c13456;hp=2aca193501b703c79ac77177000fbfc92102ae05;hpb=e08dcd0cd0d71f65cb6fad387cbe2956ed55f0e4;p=djsite.git diff --git a/quotes/views.py b/quotes/views.py index 2aca193..01cb4e3 100644 --- a/quotes/views.py +++ b/quotes/views.py @@ -4,8 +4,12 @@ from random import randint from quotes.models import Author, Work, Quote, QuoteTag import quotes.search as search +import quotes.tagcloud as tagcloud + +# create your views here. +def index(request): + return render(request, 'quotes/index.html') -# Create your views here. def onequote(request, quote_id): q = Quote.objects.get(id=quote_id) q.incr_display() @@ -43,3 +47,7 @@ def searchpage(request): if 'q' in request.POST: results = search.search(request.POST['q']) return render(request, 'quotes/search.html', results) + +def cloud(request): + clouddata = tagcloud.build_cloud() + return render(request, 'quotes/cloud.html', { 'cloud': clouddata })