[form] fix bw compat issue introduced by 5588:377c9adfe81e stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 26 May 2010 14:59:05 +0200
branchstable
changeset 5592 41ad8ca3047e
parent 5589 25bf54dab82b
child 5593 f6c55bec9326
[form] fix bw compat issue introduced by 5588:377c9adfe81e
web/views/autoform.py
--- a/web/views/autoform.py	Wed May 26 12:31:45 2010 +0200
+++ b/web/views/autoform.py	Wed May 26 14:59:05 2010 +0200
@@ -125,6 +125,7 @@
 
 from logilab.mtconverter import xml_escape
 from logilab.common.decorators import iclassmethod, cached
+from logilab.common.deprecation import deprecated
 
 from cubicweb import typed_eid, neg_role, uilib
 from cubicweb.schema import display_name
@@ -646,6 +647,18 @@
     # action on the form tag
     _default_form_action_path = 'validateform'
 
+    # pre 3.8.3 compat
+    @property
+    def set_action(self, action):
+        self._action = action
+    @deprecated('[3.9] use form.form_action()')
+    def get_action(self):
+        try:
+            return self._action
+        except AttributeError:
+            return self._cw.build_url(self._default_form_action_path)
+    action = property(get_action, set_action)
+
     @iclassmethod
     def field_by_name(cls_or_self, name, role=None, eschema=None):
         """return field with the given name and role. If field is not explicitly