Package trac :: Module attachment :: Class Attachment

Class Attachment

source code

object --+
         |
        Attachment

Represents an attachment (new or existing).
Instance Methods
 
__init__(self, env, parent_realm_or_attachment_resource, parent_id=None, filename=None)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
__repr__(self)
repr(x)
source code
 
delete(self)
Delete the attachment, both the record in the database and the file itself.
source code
 
reparent(self, new_realm, new_id) source code
 
insert(self, filename, fileobj, size, t=None)
Create a new Attachment record and save the file content.
source code
 
open(self) source code

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

Class Methods
 
select(cls, env, parent_realm, parent_id)
Iterator yielding all Attachment instances attached to resource identified by parent_realm and parent_id.
source code
 
delete_all(cls, env, parent_realm, parent_id)
Delete all attachments of a given resource.
source code
 
reparent_all(cls, env, parent_realm, parent_id, new_realm, new_id)
Reparent all attachments of a given resource to another resource.
source code
Class Variables
  realm = 'attachment'
Properties
  resource
  path
  title

Inherited from object: __class__

Method Details

__init__(self, env, parent_realm_or_attachment_resource, parent_id=None, filename=None)
(Constructor)

source code 
x.__init__(...) initializes x; see help(type(x)) for signature
Overrides: object.__init__
(inherited documentation)

__repr__(self)
(Representation operator)

source code 
repr(x)
Overrides: object.__repr__
(inherited documentation)

select(cls, env, parent_realm, parent_id)
Class Method

source code 
Iterator yielding all Attachment instances attached to resource identified by parent_realm and parent_id.
Returns:
a tuple containing the filename, description, size, time, author and ipnr.

Property Details

resource

Get Method:
unreachable.resource(self)

path

Get Method:
unreachable.path(self)

title

Get Method:
unreachable.title(self)