# HG changeset patch # User Sverre Rabbelier # Date 1234709729 0 # Node ID c007dc7d00ca20b5b5e6a43abf7768c46529caa7 # Parent 4b8546a3b20ccf3278fa8c3b896e27807366edee Make _constructResponsoe take an optional template Patch by: Sverre Rabbelier diff -r 4b8546a3b20c -r c007dc7d00ca app/soc/views/models/base.py --- a/app/soc/views/models/base.py Sun Feb 15 14:55:05 2009 +0000 +++ b/app/soc/views/models/base.py Sun Feb 15 14:55:29 2009 +0000 @@ -697,7 +697,8 @@ pass - def _constructResponse(self, request, entity, context, form, params): + def _constructResponse(self, request, entity, context, + form, params, template=None): """Updates the context and returns a response for the specified arguments. Args: @@ -706,6 +707,7 @@ context: the context to be used form: the form that will be used and set in the context params: a dict with params for this View + template: if specified, this template is Params usage: name: The name_plural value is used to set the entity_type @@ -735,10 +737,11 @@ if params.get('export_content_type') and entity: context['export_link'] = redirects.getExportRedirect(entity, params) - if entity: - template = params['edit_template'] - else: - template = params['create_template'] + if not template: + if entity: + template = params['edit_template'] + else: + template = params['create_template'] self._editContext(request, context) return helper.responses.respond(request, template, context)