Exemplo n.º 1
0
 def valueRepr(self, val):
     "prepare value for display in detail area."
     # pr "valueRepr", type(val), val.__class__.__name__, "<hr>"
     if isinstance(val, specialValues.SpecialValue):
         val = val.html(self)
     elif type(val) is types.StringType:
         val = entry.quote(val)
     if self.preformattedText:
         return "<pre>%s</pre>" % val
     return repr(val)
Exemplo n.º 2
0
 def makeDisplay(self, entry0):
     "make a summary display for a given entry."
     attrDict = entry0.attrDict()
     identity = entry0.identity()
     labelvalue = str(identity)
     labelAttribute = self.labelAttribute
     if attrDict.has_key(labelAttribute):
         labelList = attrDict[labelAttribute]
         labelValues = [str(x) for x in labelList]
         labelvalue = " :: ".join(labelValues)
         labelvalue += " (%s)" % identity
     return self.href(entry.quote(labelvalue), attr="FocusId", attrValue=identity)