Make it possible to add some default values to the context
Currently only used in show, but easy enough to add elsewhere.
Patch by: Sverre Rabbelier
--- a/app/soc/views/helper/params.py Thu Mar 05 17:44:48 2009 +0000
+++ b/app/soc/views/helper/params.py Thu Mar 05 19:20:02 2009 +0000
@@ -225,6 +225,8 @@
new_params['list_template'] = 'soc/models/list.html'
new_params['invite_template'] = 'soc/models/invite.html'
+ new_params['context'] = None
+
new_params['export_content_type'] = None
new_params['export_extension'] = '.txt'
--- a/app/soc/views/models/base.py Thu Mar 05 17:44:48 2009 +0000
+++ b/app/soc/views/models/base.py Thu Mar 05 19:20:02 2009 +0000
@@ -122,6 +122,8 @@
context['entity_type'] = params['name']
context['entity_type_url'] = params['url_name']
+ context = dicts.merge(params['context'], context)
+
template = params['public_template']
return helper.responses.respond(request, template, context=context)