示例#1
0
 def displayValue(self):
     value = []
     for token in self.value:
         # Ignore no value entries. They are in the request only.
         if token == self.noValueToken:
             continue
         term = self.terms.getTermByToken(token)
         if zope.schema.interfaces.ITitledTokenizedTerm.providedBy(term):
             value.append(translate(
                 term.title, context=self.request, default=term.title))
         else:
             value.append(term.value)
     return value
示例#2
0
文件: widget.py 项目: bendavis78/zope
 def displayValue(self):
     value = []
     for token in self.value:
         # Ignore no value entries. They are in the request only.
         if token == self.noValueToken:
             continue
         term = self.terms.getTermByToken(token)
         if zope.schema.interfaces.ITitledTokenizedTerm.providedBy(term):
             value.append(
                 translate(term.title,
                           context=self.request,
                           default=term.title))
         else:
             value.append(term.token)
     return value
示例#3
0
文件: widget.py 项目: Shoobx/z3c.form
 def displayValue(self):
     value = []
     for token in self.value:
         # Ignore no value entries. They are in the request only.
         if token == self.noValueToken:
             continue
         try:
             term = self.terms.getTermByToken(token)
         except LookupError:
             # silently ignore missing tokens, because INPUT_MODE and
             # HIDDEN_MODE does that too
             continue
         if zope.schema.interfaces.ITitledTokenizedTerm.providedBy(term):
             value.append(translate(
                 term.title, context=self.request, default=term.title))
         else:
             value.append(term.value)
     return value
示例#4
0
 def displayValue(self):
     value = []
     for token in self.value:
         # Ignore no value entries. They are in the request only.
         if token == self.noValueToken:
             continue
         try:
             term = self.terms.getTermByToken(token)
         except LookupError:
             # silently ignore missing tokens, because INPUT_MODE and
             # HIDDEN_MODE does that too
             continue
         if zope.schema.interfaces.ITitledTokenizedTerm.providedBy(term):
             value.append(translate(
                 term.title, context=self.request, default=term.title))
         else:
             value.append(term.value)
     return value