From 040f43fc74e8026c2aa804fe2bd1e7220a9cb96d Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Sun, 10 Feb 2008 15:17:29 +0100 Subject: [PATCH] * Add a influence_list view. --- influences/views.py | 5 +++++ urls.py | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/influences/views.py b/influences/views.py index 3ff3ca8..1ff4dcb 100644 --- a/influences/views.py +++ b/influences/views.py @@ -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 c96c6b1..996e08a 100644 --- 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\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\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\d+)/$', 'ee.influences.views.character_detail', name='influences_character_detail'), -- 2.30.2