Add an _editContext hook
authorSverre Rabbelier <srabbelier@gmail.com>
Wed, 11 Feb 2009 23:47:13 +0000
changeset 1269 62b1e9ee46c5
parent 1268 9d092b702f92
child 1270 a48a592919b0
Add an _editContext hook Usefull when one wants to have a hook that will always be called. Patch by: Sverre Rabbelier
app/soc/views/models/base.py
--- a/app/soc/views/models/base.py	Wed Feb 11 23:44:38 2009 +0000
+++ b/app/soc/views/models/base.py	Wed Feb 11 23:47:13 2009 +0000
@@ -678,6 +678,16 @@
     if field and value:
       seed[field] = value
 
+  def _editContext(self, request, context):
+    """Performs any required processing on the context for edit pages.
+
+    Args:
+      request: the django request object
+      context: the context dictionary that will be used
+    """
+
+    pass
+
   def _constructResponse(self, request, entity, context, form, params):
     """Updates the context and returns a response for the specified arguments.
 
@@ -721,6 +731,7 @@
     else:
       template = params['create_template']
 
+    self._editContext(request, context)
     return helper.responses.respond(request, template, context)
 
   def getParams(self):