ChangeStateForm: extract method redirectpath() for easier subclassing
authorAdrien Di Mascio <Adrien.DiMascio@logilab.fr>
Mon, 08 Dec 2008 14:47:07 +0100
changeset 186 5e550c6e554c
parent 185 9fc69c46e5e7
child 187 cae87ca76f02
child 189 46fea7075866
ChangeStateForm: extract method redirectpath() for easier subclassing
web/views/baseforms.py
--- a/web/views/baseforms.py	Mon Dec 08 11:46:49 2008 +0100
+++ b/web/views/baseforms.py	Mon Dec 08 14:47:07 2008 +0100
@@ -118,7 +118,7 @@
         self.w(u'<input type="hidden" name="%s" value="%s"/>\n'
                % (eid_param('state', eid), dest.eid))
         self.w(u'<input type="hidden" name="__redirectpath" value="%s"/>\n'
-               % html_escape(entity.rest_path()))
+               % html_escape(self.redirectpath(entity)))
         self.fill_form(entity, state, dest)
         self.w(u'<input type="hidden" name="__method" value="set_state"/>\n')
         self.w(self.button_ok(label=stdmsgs.YES, tabindex=self.req.next_tabindex()))
@@ -144,6 +144,9 @@
         self.w(u'<textarea rows="10" cols="80" name="%s" tabindex="%s"></textarea><br/>\n'
                % (cformname, self.req.next_tabindex()))
 
+    def redirectpath(self, entity):
+        return entity.rest_path()
+
 
 class ClickAndEditForm(EntityForm):
     id = 'reledit'