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
def _makeToken(self, value): """create a unique valid ASCII token""" return util.createCSSId(util.toUnicode(value))