示例#1
0
 def getTerm(self, value):
     try:
         return self.vocabulary.getTerm(value)
     except LookupError:
         # all form widgets are called when using plone.formwidget.masterselect on a form field
         # this is done as anonymous and the vocabulary is then empty
         # it's not necessary here to render the correct term
         # see z3c.form.term
         if '++widget++' in self.context.REQUEST.get('URL', ''):
             return SimpleTerm(value, util.createCSSId(util.toUnicode(value)),
                               title=_zf(u'Missing: ${value}', mapping=dict(value=util.toUnicode(value))))
         raise
示例#2
0
文件: term.py 项目: CGTIC/Plone_SP
 def _makeToken(self, value):
     """create a unique valid ASCII token"""
     return util.createCSSId(util.toUnicode(value))
示例#3
0
 def _makeToken(self, value):
     """create a unique valid ASCII token"""
     return util.createCSSId(util.toUnicode(value))