From: Matthijs Kooijman Date: Sun, 10 Feb 2008 14:17:29 +0000 (+0100) Subject: * Add a influence_list view. X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=040f43fc74e8026c2aa804fe2bd1e7220a9cb96d;p=matthijs%2Fprojects%2Fxerxes.git * Add a influence_list view. --- 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'),