* No longer use any generic views, since we will need to add access checks anyway...
authorMatthijs Kooijman <matthijs@stdin.nl>
Sat, 9 Feb 2008 22:50:18 +0000 (23:50 +0100)
committerMatthijs Kooijman <matthijs@stdin.nl>
Sat, 9 Feb 2008 22:50:18 +0000 (23:50 +0100)
influences/views.py
urls.py

index 71e69ed98628067b473a1d71b040473af35b2d2c..ba8e280aaa0a2bf177fe4af2e062d17e65f98d5a 100644 (file)
@@ -67,15 +67,18 @@ def index(request):
     return render_to_response('influences/index.html', {'characters' : characters, 'influences' : influences}, RequestContext(request))
 
 @login_required
-def character_list(*args, **kwargs):
-    return object_list(*args, **kwargs)
+def character_list(request):
+    os = request.user.character_set.all()
+    return render_to_response('influences/character_list.html', {'object_list' : os}, RequestContext(request))
 
 @login_required
-def character_detail(*args, **kwargs):
-    return object_detail(*args, **kwargs)
+def character_detail(request, object_id):
+    o = Character.objects.get(pk=object_id)
+    return render_to_response('influences/character_detail.html', {'object' : o}, RequestContext(request))
 
 @login_required
-def influence_detail(*args, **kwargs):
-    return object_detail(*args, **kwargs)
+def influence_detail(request, object_id):
+    o = Influence.objects.get(pk=object_id)
+    return render_to_response('influences/influence_detail.html', {'object' : o}, RequestContext(request))
 
 # vim: set sts=4 sw=4 expandtab:
diff --git a/urls.py b/urls.py
index c873e1a1f091ae50f4f2665d0e0841837a1bedb5..c96c6b1b46b17705df357468f49416e440855b89 100644 (file)
--- a/urls.py
+++ b/urls.py
@@ -3,14 +3,6 @@ from django.conf.urls.defaults import *
 from ee.influences.models import Character
 from ee.influences.models import Influence
 import os
-
-chars_dict = {
-    'queryset': Character.objects.all(),
-}
-influences_dict = {
-    'queryset': Influence.objects.all(),
-}
  
 urlpatterns = patterns('',
     url(r'^$', 'django.views.generic.simple.redirect_to', {'url' : '/influences/'}),
@@ -19,10 +11,10 @@ urlpatterns = patterns('',
     url(r'^influences/$', 'ee.influences.views.index', name='influences_index'),
     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', influences_dict, name='influences_influence_detail'),
+    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', chars_dict, name='influences_character_list'),
-    url(r'^influences/character/(?P<object_id>\d+)/$', 'ee.influences.views.character_detail', chars_dict, name='influences_character_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'),
     url(r'^influences/character/add/$', 'ee.influences.views.addCharacter', name='influences_add_character'),
 
     url(r'^accounts/login/$', 'django.contrib.auth.views.login', {'template_name': 'base/login.html'}, name='login'),