--- a/web/controller.py Tue Jun 30 08:05:18 2009 +0200
+++ b/web/controller.py Tue Jun 30 08:05:57 2009 +0200
@@ -182,6 +182,12 @@
elif '__redirectpath' in self.req.form:
# if redirect path was explicitly specified in the form, use it
path = self.req.form['__redirectpath']
+ if self._edited_entity:
+ msg = newparams.get('__message', '')
+ msg += ' (<a href="%s">%s</a>)' % (
+ self._edited_entity.absolute_url(),
+ self.req._('click here to see created entity'))
+ newparams['__createdpath'] = self._edited_entity.rest_path()
elif self._after_deletion_path:
# else it should have been set during form processing
path, params = self._after_deletion_path
--- a/web/request.py Tue Jun 30 08:05:18 2009 +0200
+++ b/web/request.py Tue Jun 30 08:05:57 2009 +0200
@@ -150,6 +150,11 @@
del self.form[k]
else:
self.form[k] = v
+ # special key for created entity, added in controller's reset method
+ if '__createdpath' in params:
+ self.message += ' (<a href="%s">%s</a>)' % (
+ self.build_url(params.pop('__createdpath')),
+ self._('click here to see created entity'))
def no_script_form_param(self, param, default=None, value=None):
"""ensure there is no script in a user form param