From d7ec83278b295b76ba2694e01b99b2c79e846611 Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Sun, 10 Feb 2008 15:19:10 +0100 Subject: [PATCH] * Use a relationship spanning lookup to get the list of a player's influences, instead of using two lookups. --- influences/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/influences/views.py b/influences/views.py index 1ff4dcb..cd8d4a9 100644 --- a/influences/views.py +++ b/influences/views.py @@ -62,8 +62,9 @@ def addCharacter(request): @login_required def index(request): + # Only show this player's characters and influences characters = request.user.character_set.all() - influences = Influence.objects.filter(character__in=characters) + influences = Influence.objects.filter(character__player=request.user) return render_to_response('influences/index.html', {'characters' : characters, 'influences' : influences}, RequestContext(request)) @login_required -- 2.30.2