cwvreg.py
changeset 1254 585f3c476a18
parent 1123 a8e2838f174a
child 1263 01152fffd593
child 1381 6042f1b342bb
equal deleted inserted replaced
1245:298269ba818f 1254:585f3c476a18
   320         req.form['value'] = pdef['default'] # XXX hack to pass the default value
   320         req.form['value'] = pdef['default'] # XXX hack to pass the default value
   321         vocab = pdef['vocabulary']
   321         vocab = pdef['vocabulary']
   322         if vocab is not None:
   322         if vocab is not None:
   323             if callable(vocab):
   323             if callable(vocab):
   324                 # list() just in case its a generator function
   324                 # list() just in case its a generator function
   325                 vocabfunc = lambda e: list(vocab(propkey, req))
   325                 vocabfunc = lambda **kwargs: list(vocab(propkey, req))
   326             else:
   326             else:
   327                 vocabfunc = lambda e: vocab
   327                 vocabfunc = lambda **kwargs: vocab
   328             w = StaticComboBoxWidget(self, 'EProperty', self.schema['value'], 'String',
   328             w = StaticComboBoxWidget(self, 'EProperty', self.schema['value'], 'String',
   329                                      vocabfunc=vocabfunc, description=tr(pdef['help']),
   329                                      vocabfunc=vocabfunc, description=tr(pdef['help']),
   330                                      **attrs)
   330                                      **attrs)
   331         else:
   331         else:
   332             w = widget_factory(self, 'EProperty', self.schema['value'], pdef['type'],
   332             w = widget_factory(self, 'EProperty', self.schema['value'], pdef['type'],