Package trac :: Module attachment :: Class IAttachmentManipulator

Class IAttachmentManipulator

source code

    object --+    
             |    
core.Interface --+
                 |
                IAttachmentManipulator

Extension point interface for components that need to manipulate attachments.

Unlike change listeners, a manipulator can reject changes being committed to the database.

Instance Methods
 
prepare_attachment(req, attachment, fields)
Not currently called, but should be provided for future compatibility.
source code
 
validate_attachment(req, attachment)
Validate an attachment after upload but before being stored in Trac environment.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties

Inherited from object: __class__

Method Details

validate_attachment(req, attachment)

source code 

Validate an attachment after upload but before being stored in Trac environment.

Must return a list of (field, message) tuples, one for each problem detected. field can be any of description, username, filename, content, or None to indicate an overall problem with the attachment. Therefore, a return value of [] means everything is OK.