Package couchable :: Module core :: Class CouchableAttachment
[frames] | no frames]

Class CouchableAttachment

source code

object --+
         |
        CouchableAttachment

Base class for types that should be stored as CouchDB attachments.

Note: Deriving from this class is optional; classes may also use registerAttachmentType. The only advantage to subclassing this class is that registerAttachmentType has already been called for this class.

Instance Methods

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

Static Methods
byte string
pack(obj)
@staticmethod hook point for serializing the attachment class.
source code
object
unpack(data)
@staticmethod hook point for deserializing the attachment class.
source code
Properties

Inherited from object: __class__

Method Details

pack(obj)
Static Method

source code 

@staticmethod hook point for serializing the attachment class.

Defaults to pickle.dumps(obj).

Parameters:
  • obj (object) - The object to serialize and upload as an attachment.
Returns: byte string
The serialized data.

unpack(data)
Static Method

source code 

@staticmethod hook point for deserializing the attachment class.

Defaults to pickle.dumps(obj).

Parameters:
  • data (byte string) - The serlized data to unserialize into an object.
Returns: object
The unserialized object.