From 27707e98414889484dd5e2f3f5b900504adab7c8 Mon Sep 17 00:00:00 2001 From: sanj Date: Wed, 1 Sep 2010 13:56:30 +0530 Subject: [PATCH] negative indexing not supported on querysets? wtf. --- itf/erang_organised/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/itf/erang_organised/views.py b/itf/erang_organised/views.py index d58a429..ab2899e 100644 --- a/itf/erang_organised/views.py +++ b/itf/erang_organised/views.py @@ -11,7 +11,8 @@ def home(request): if request.GET.has_key('issue_id'): issue_id = request.GET.get('issue_id') else: - issue_id = all_issues[-1].id + l = all_issues.count() - 1 + issue_id = all_issues[l].id current_issue = Issue.objects.get(pk=issue_id) other_issues = all_issues.exclude(pk=issue_id) return render_to_response("erang/home.html", {