equal
deleted
inserted
replaced
123 |
123 |
124 from warnings import warn |
124 from warnings import warn |
125 |
125 |
126 from logilab.mtconverter import xml_escape |
126 from logilab.mtconverter import xml_escape |
127 from logilab.common.decorators import iclassmethod, cached |
127 from logilab.common.decorators import iclassmethod, cached |
|
128 from logilab.common.deprecation import deprecated |
128 |
129 |
129 from cubicweb import typed_eid, neg_role, uilib |
130 from cubicweb import typed_eid, neg_role, uilib |
130 from cubicweb.schema import display_name |
131 from cubicweb.schema import display_name |
131 from cubicweb.view import EntityView |
132 from cubicweb.view import EntityView |
132 from cubicweb.selectors import ( |
133 from cubicweb.selectors import ( |
644 # which relations should be edited |
645 # which relations should be edited |
645 display_fields = None |
646 display_fields = None |
646 # action on the form tag |
647 # action on the form tag |
647 _default_form_action_path = 'validateform' |
648 _default_form_action_path = 'validateform' |
648 |
649 |
|
650 # pre 3.8.3 compat |
|
651 @property |
|
652 def set_action(self, action): |
|
653 self._action = action |
|
654 @deprecated('[3.9] use form.form_action()') |
|
655 def get_action(self): |
|
656 try: |
|
657 return self._action |
|
658 except AttributeError: |
|
659 return self._cw.build_url(self._default_form_action_path) |
|
660 action = property(get_action, set_action) |
|
661 |
649 @iclassmethod |
662 @iclassmethod |
650 def field_by_name(cls_or_self, name, role=None, eschema=None): |
663 def field_by_name(cls_or_self, name, role=None, eschema=None): |
651 """return field with the given name and role. If field is not explicitly |
664 """return field with the given name and role. If field is not explicitly |
652 defined for the form but `eclass` is specified, guess_field will be |
665 defined for the form but `eclass` is specified, guess_field will be |
653 called. |
666 called. |