* Add a influence_list view.
authorMatthijs Kooijman <matthijs@stdin.nl>
Sun, 10 Feb 2008 14:17:29 +0000 (15:17 +0100)
committerMatthijs Kooijman <matthijs@stdin.nl>
Sun, 10 Feb 2008 14:17:29 +0000 (15:17 +0100)
influences/views.py
urls.py

index 3ff3ca83f8e5e2aece4d80fbabd19d6d9df9e2e7..1ff4dcbd02088c5eb0ea53295fe888a891f6d1a3 100644 (file)
@@ -78,6 +78,11 @@ def character_detail(request, object_id):
         return HttpResponseForbidden("Forbidden -- Trying to view somebody else's character")
     return render_to_response('influences/character_detail.html', {'object' : o}, RequestContext(request))
 
+@login_required
+def influence_list(request):
+    os = Influence.objects.filter(character__player=request.user)
+    return render_to_response('influences/influence_list.html', {'object_list' : os}, RequestContext(request))
+
 @login_required
 def influence_detail(request, object_id):
     o = Influence.objects.get(pk=object_id)
diff --git a/urls.py b/urls.py
index c96c6b1b46b17705df357468f49416e440855b89..996e08a7c4ba617006c8957cdf1cda518c1d3acd 100644 (file)
--- a/urls.py
+++ b/urls.py
@@ -9,9 +9,10 @@ urlpatterns = patterns('',
     url(r'^admin/', include('django.contrib.admin.urls')),
 
     url(r'^influences/$', 'ee.influences.views.index', name='influences_index'),
+    url(r'^influences/influence/$', 'ee.influences.views.influence_list', name='influences_influence_list'),
+    url(r'^influences/influence/(?P<object_id>\d+)/$', 'ee.influences.views.influence_detail', name='influences_influence_detail'),
     url(r'^influences/influence/add/(\d+)/$', 'ee.influences.views.add', name='influences_add_influence_for_character'),
     url(r'^influences/influence/add/$', 'ee.influences.views.add', name='influences_add_influence'),
-    url(r'^influences/influence/(?P<object_id>\d+)/$', 'ee.influences.views.influence_detail', name='influences_influence_detail'),
     
     url(r'^influences/character/$', 'ee.influences.views.character_list', name='influences_character_list'),
     url(r'^influences/character/(?P<object_id>\d+)/$', 'ee.influences.views.character_detail', name='influences_character_detail'),