Author: floguy
Date: Sun Oct 5 18:42:19 2008
New Revision: 1023
Modified:
trunk/apps/core_apps/games/urls.py
trunk/apps/core_apps/games/views.py
Log:
Added a group listing to the context of the games page, for use if wanted
in other projects.
Modified: trunk/apps/core_apps/games/urls.py
==============================================================================
--- trunk/apps/core_apps/games/urls.py (original)
+++ trunk/apps/core_apps/games/urls.py Sun Oct 5 18:42:19 2008
@@ -5,5 +5,9 @@
thing = GameThingGroup(GameThing, group_func=group_dicts)
urlpatterns = thing.urls(name_prefix='games') + patterns('games',
- url(r'^game/(?P<slug>[a-zA-Z0-9_-]+)/$', 'views.game_detail',
name='game_detail'),
+ url(
+ r'^game/(?P<slug>[a-zA-Z0-9_-]+)/$',
+ 'views.game_detail',
+ {'extra_context': {'groups': thing.groups}},
+ name='game_detail'),
)
Modified: trunk/apps/core_apps/games/views.py
==============================================================================
--- trunk/apps/core_apps/games/views.py (original)
+++ trunk/apps/core_apps/games/views.py Sun Oct 5 18:42:19 2008
@@ -3,10 +3,12 @@
from django.shortcuts import get_object_or_404, render_to_response
from django.template import RequestContext
-def game_detail(request, slug='', template_name='games/game_detail.html'):
+def game_detail(request, slug='', template_name='games/game_detail.html',
+ extra_context={}):
game = get_object_or_404(Game, slug=slug.lower())
if request.META.get('HTTP_REFERER', '') != request.path:
game.add_play()
- return render_to_response(template_name, {
- 'game': game,
- }, context_instance=RequestContext(request))
+ context = {'game': game}
+ context.update(extra_context)
+ return render_to_response(template_name, context,
+ context_instance=RequestContext(request))
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pinax-updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/pinax-updates?hl=en
-~----------~----~----~----~------~----~------~--~---