Package posterity :: Module model :: Class Conv

Class Conv



          object --+    
                   |    
elixir.entity.Entity --+
                       |
                      Conv

A Conversation is a set of related messages.

All messages usually belong to the same thread of conversation.



Nested Classes

Inherited from elixir.entity.Entity: __metaclass__

Instance Methods
 
add_tag(self, tag)
Associate the current conversation with tag
 
remove_tag(self, tag)
Untag the current conversation
 
mark_as_deleted(self)
Mark the entire conversation and all associated messages as deleted.
 
undelete(self)
Mark the entire conversation and all associated messages as deleted.
 
mark_as_read(self, deleted=False)
Mark all messages in the conversation as read
 
__init__(self, *args, **kwargs)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
 
delete(self, *args, **kwargs)
 
expire(self, *args, **kwargs)
 
expunge(self, *args, **kwargs)
 
flush(self, *args, **kwargs)
 
merge(self, *args, **kwargs)
 
refresh(self, *args, **kwargs)
 
save(self, *args, **kwargs)
 
save_or_update(self, *args, **kwargs)
 
update(self, *args, **kwargs)

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

Class Methods
 
count(self, *args, **kwargs)
 
count_by(self, *args, **kwargs)
 
filter(self, *args, **kwargs)
 
filter_by(self, *args, **kwargs)
 
get(self, *args, **kwargs)
 
get_by(self, *args, **kwargs)
 
instances(self, *args, **kwargs)
 
join_to(self, *args, **kwargs)
 
join_via(self, *args, **kwargs)
 
options(self, *args, **kwargs)
 
query(cls)
 
select(self, *args, **kwargs)
 
select_by(self, *args, **kwargs)
 
selectfirst(self, *args, **kwargs)
 
selectfirst_by(self, *args, **kwargs)
 
selectone(self, *args, **kwargs)
 
selectone_by(self, *args, **kwargs)
Static Methods
 
for_message(account, message)
Returns the Conv instance to which message belongs.
 
search(query, limit=100, offset=0, deleted=False)
Return conversations matching the query
Class Variables
  __elixir_statements__ = [(<elixir.statements.Statement object ...
  account = <sqlalchemy.orm.unitofwork.UOWProperty object at 0x2...
  account_id = <sqlalchemy.orm.unitofwork.UOWProperty object at ...
  c = <sqlalchemy.orm.mapper.LOrderedProp object at 0x21805f0>
  deleted_msgs = <sqlalchemy.orm.unitofwork.UOWProperty object a...
  id = <sqlalchemy.orm.unitofwork.UOWProperty object at 0x21a6630>
  mapper = <sqlalchemy.orm.mapper.Mapper object at 0x21805b0>
  msgs = <sqlalchemy.orm.unitofwork.UOWProperty object at 0x21a6...
  table = Table('conv',MetaData(),Column('id',Integer(),primary_...
  tags = <sqlalchemy.orm.unitofwork.UOWProperty object at 0x21b4...
Properties

Inherited from object: __class__

Method Details

for_message(account, message)
Static Method

 

Returns the Conv instance to which message belongs.

If no existing conversation is found a new is created. The 'in-reply-to' and 'references' headers if present are used to locate the conversation. If these headers are missing the subject header is used as a last resort.

mark_as_deleted(self)

 

Mark the entire conversation and all associated messages as deleted.

Deleted conversations and messages are not normally displayed in a conversation index or conversation view. The 'Trash' and 'Spam' tags are exceptions to this rule.

undelete(self)

 

Mark the entire conversation and all associated messages as deleted.

Deleted conversations and messages are not normally displayed in a conversation index or conversation view. The 'Trash' and 'Spam' tags are exceptions to this rule.

mark_as_read(self, deleted=False)

 

Mark all messages in the conversation as read

If @deleted is True all messages marked for deletions are marked as read.

__init__(self, *args, **kwargs)
(Constructor)

 
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
Overrides: object.__init__
(inherited documentation)

Class Variable Details

__elixir_statements__

Value:
[(<elixir.statements.Statement object at 0x20dbcf0>,
  ('id', <class 'sqlalchemy.types.Integer'>),
  {'primary_key': True}),
 (<elixir.statements.Statement object at 0x20e52f0>,
  ('tags'),
  {'lazy': False, 'of_kind': 'Tag', 'tablename': 'conv_to_tag'}),
 (<elixir.statements.Statement object at 0x20e5290>,
  ('account'),
...

account

Value:
<sqlalchemy.orm.unitofwork.UOWProperty object at 0x21a6570>

account_id

Value:
<sqlalchemy.orm.unitofwork.UOWProperty object at 0x21a66b0>

deleted_msgs

Value:
<sqlalchemy.orm.unitofwork.UOWProperty object at 0x21a6d50>

msgs

Value:
<sqlalchemy.orm.unitofwork.UOWProperty object at 0x21a69d0>

table

Value:
Table('conv',MetaData(),Column('id',Integer(),primary_key=True,nullabl\
e=False),Column('account_id',Integer(),ForeignKey('account.id'),nullab\
le=False),schema=None)

tags

Value:
<sqlalchemy.orm.unitofwork.UOWProperty object at 0x21b4910>