sobjects/parsers.py
branchstable
changeset 7879 9aae456abab5
parent 7727 70ea754d3e04
child 7916 54e240c1b419
equal deleted inserted replaced
7874:be04706eacc9 7879:9aae456abab5
    30    }
    30    }
    31 
    31 
    32 """
    32 """
    33 
    33 
    34 import os.path as osp
    34 import os.path as osp
    35 from datetime import datetime, timedelta
    35 from datetime import datetime, timedelta, time
    36 from urllib import urlencode
    36 from urllib import urlencode
    37 from cgi import parse_qs # in urlparse with python >= 2.6
    37 from cgi import parse_qs # in urlparse with python >= 2.6
    38 
    38 
    39 from logilab.common.date import todate, totime
    39 from logilab.common.date import todate, totime
    40 from logilab.common.textutils import splitstrip, text_to_dict
    40 from logilab.common.textutils import splitstrip, text_to_dict
   149             action = options.pop('action')
   149             action = options.pop('action')
   150             linker = self.select_linker(action, rtype, role)
   150             linker = self.select_linker(action, rtype, role)
   151             linker.check_options(options, schemacfg.eid)
   151             linker.check_options(options, schemacfg.eid)
   152         except KeyError:
   152         except KeyError:
   153             msg = _('"action" must be specified in options; allowed values are '
   153             msg = _('"action" must be specified in options; allowed values are '
   154                     '%s') % ', '.join(self.action_methods)
   154                     '%s') % ', '.join(self.list_actions())
   155             raise ValidationError(schemacfg.eid, {rn('options', 'subject'): msg})
   155             raise ValidationError(schemacfg.eid, {rn('options', 'subject'): msg})
   156         except RegistryException:
   156         except RegistryException:
   157             msg = _('allowed values for "action" are %s') % ', '.join(self.list_actions())
   157             msg = _('allowed values for "action" are %s') % ', '.join(self.list_actions())
   158             raise ValidationError(schemacfg.eid, {rn('options', 'subject'): msg})
   158             raise ValidationError(schemacfg.eid, {rn('options', 'subject'): msg})
   159         if not checkonly:
   159         if not checkonly: