* Use a relationship spanning lookup to get the list of a player's influences, inste...
authorMatthijs Kooijman <matthijs@stdin.nl>
Sun, 10 Feb 2008 14:19:10 +0000 (15:19 +0100)
committerMatthijs Kooijman <matthijs@stdin.nl>
Sun, 10 Feb 2008 14:19:10 +0000 (15:19 +0100)
influences/views.py

index 1ff4dcbd02088c5eb0ea53295fe888a891f6d1a3..cd8d4a942d61a30c3e0bd2aab72496bc56acd7bf 100644 (file)
@@ -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