Package qm :: Module attachment :: Class TemporaryAttachmentStore
[hide private]
[frames] | no frames]

Class TemporaryAttachmentStore

source code

     object --+        
              |        
AttachmentStore --+    
                  |    
FileAttachmentStore --+
                      |
                     TemporaryAttachmentStore

Temporary storage for attachment data.

A 'TemporaryAttachmentStore' stores attachment data in a temporary location, for up to the lifetime of the running program. When the program ends, all temporarily stored attachment data is deleted.

A data object in the temporary store is identified by its location. Locations should be generated by 'make_temporary_location'.

Instance Methods [hide private]
 
__init__(self)
Construct a temporary attachment store.
source code
 
HandleUploadRequest(self, request)
Handle a web request to upload attachment data.
source code

Inherited from FileAttachmentStore: GetData, GetDataFile, GetSize, Remove, Store

Inherited from AttachmentStore: HandleDownloadRequest

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 

Construct a temporary attachment store.

The store is initially empty.

Overrides: object.__init__

HandleUploadRequest(self, request)

source code 

Handle a web request to upload attachment data.

Store the attachment data contained in the request as a temporary attachment. It is assumed that the request is being submitted from a popup upload browser window, so the returned HTML page instructs the window to close itself.

'request' -- A 'WebRequest' object.

returns -- HTML text of a page that instructs the browser window to close.