From 4b29603d79cc1f79c66786684f27ec9abfbaa825 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Mon, 17 Oct 2011 01:34:04 +0200 Subject: Initial commit --- main/views.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 main/views.py (limited to 'main/views.py') diff --git a/main/views.py b/main/views.py new file mode 100644 index 0000000..91e20dd --- /dev/null +++ b/main/views.py @@ -0,0 +1,13 @@ +from django.http import HttpResponse +from django.shortcuts import render_to_response +from django.template import Context, loader +from main.models import Activity + +def index(request): + activity_list = Activity.objects.all().order_by("-date")[:5] + t = loader.get_template("home.html") + c = Context({ + "activitylist": activity_list, + }) + + return HttpResponse(t.render(c)) -- cgit v1.2.3-54-g00ecf