web/views/forms.py
changeset 10714 8a2ec43fcf44
parent 10662 10942ed172de
child 10786 2ef74a6e6785
equal deleted inserted replaced
10713:ec0f96cd7a18 10714:8a2ec43fcf44
    46 
    46 
    47 
    47 
    48 from warnings import warn
    48 from warnings import warn
    49 
    49 
    50 import time
    50 import time
       
    51 import inspect
    51 
    52 
    52 from logilab.common import dictattr, tempattr
    53 from logilab.common import dictattr, tempattr
    53 from logilab.common.decorators import iclassmethod, cached
    54 from logilab.common.decorators import iclassmethod, cached
    54 from logilab.common.textutils import splitstrip
    55 from logilab.common.textutils import splitstrip
    55 from logilab.common.deprecation import deprecated
    56 from logilab.common.deprecation import deprecated
   255         if editedfields is None:
   256         if editedfields is None:
   256             try:
   257             try:
   257                 editedfields = self._cw.form['_cw_fields']
   258                 editedfields = self._cw.form['_cw_fields']
   258             except KeyError:
   259             except KeyError:
   259                 raise RequestError(self._cw._('no edited fields specified'))
   260                 raise RequestError(self._cw._('no edited fields specified'))
   260         entityform = entity and self.field_by_name.im_func.func_code.co_argcount == 4 # XXX
   261         entityform = entity and len(inspect.getargspec(self.field_by_name)) == 4 # XXX
   261         for editedfield in splitstrip(editedfields):
   262         for editedfield in splitstrip(editedfields):
   262             try:
   263             try:
   263                 name, role = editedfield.split('-')
   264                 name, role = editedfield.split('-')
   264             except Exception:
   265             except Exception:
   265                 name = editedfield
   266                 name = editedfield