Logo Search packages:      
Sourcecode: zope-attachmentfield version File versions  Download package

def AttachmentField::AttachmentField::AttachmentField::getPreview (   self,
  instance 
)

Return the preview for this object

Definition at line 261 of file AttachmentField.py.

00261                                   :
        """Return the preview for this object
        """
        if self.isEmpty(instance):
            return ""

        # Compute it if necessary
        name = self.getName()
        if not getattr(instance, _preview_ % name, None):
            handler = self._getHandler(instance)
            try:
                preview = handler.getPreview(self, instance, )
            except:
                self._logException(instance)
                preview = None
            setattr(instance, _preview_ % name, preview, )

        # Return it
        return getattr(instance, _preview_ % name, None)

    def getIcon(self, instance):


Generated by  Doxygen 1.6.0   Back to index