# HG changeset patch # User Sverre Rabbelier # Date 1234396033 0 # Node ID 62b1e9ee46c55c046118ab28f4ded408784ba013 # Parent 9d092b702f9289bb491187891f4135081e15d2dd Add an _editContext hook Usefull when one wants to have a hook that will always be called. Patch by: Sverre Rabbelier diff -r 9d092b702f92 -r 62b1e9ee46c5 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):