Package posterity :: Module model :: Class Msg

Class Msg



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

Each Msg instance represents an email message

The actual RFC2822 data is stored in the payload column unchanged. But for performance reasons a couple of important header values are extracted and stored in dedicated columns for easy access.



Nested Classes

Inherited from elixir.entity.Entity: __metaclass__

Instance Methods
 
__repr__(self)
repr(x)
 
quote_body(self)
Returns a quoted version of the message.
 
__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__, __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
 
parse_message(account, message)
Parses an email.Message.Message
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 0x217b670>
  cc = <sqlalchemy.orm.unitofwork.UOWProperty object at 0x21a0d90>
  conv = <sqlalchemy.orm.unitofwork.UOWProperty object at 0x21a0...
  conv_id = <sqlalchemy.orm.unitofwork.UOWProperty object at 0x2...
  date = <sqlalchemy.orm.unitofwork.UOWProperty object at 0x21a0...
  from_ = <sqlalchemy.orm.unitofwork.UOWProperty object at 0x21a...
  from_email = <sqlalchemy.orm.unitofwork.UOWProperty object at ...
  from_name = <sqlalchemy.orm.unitofwork.UOWProperty object at 0...
  id = <sqlalchemy.orm.unitofwork.UOWProperty object at 0x21a0e90>
  is_deleted = <sqlalchemy.orm.unitofwork.UOWProperty object at ...
  is_unread = <sqlalchemy.orm.unitofwork.UOWProperty object at 0...
  mapper = <sqlalchemy.orm.mapper.Mapper object at 0x217b630>
  msg_id = <sqlalchemy.orm.unitofwork.UOWProperty object at 0x21...
  payload = <sqlalchemy.orm.unitofwork.UOWProperty object at 0x2...
  subject = <sqlalchemy.orm.unitofwork.UOWProperty object at 0x2...
  table = Table('msg',MetaData(),Column('id',Integer(),primary_k...
  to = <sqlalchemy.orm.unitofwork.UOWProperty object at 0x21a0f10>
Properties

Inherited from object: __class__

Method Details

__repr__(self)
(Representation operator)

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

parse_message(account, message)
Static Method

 

Parses an email.Message.Message

Figure out which conversation the message belongs to and stores it in the database.

quote_body(self)

 

Returns a quoted version of the message.

The first line will begin with 'X wrote:'

__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 0x20dbcf0>,
  ('is_deleted', <class 'sqlalchemy.types.Boolean'>),
  {'default': False, 'nullable': False}),
 (<elixir.statements.Statement object at 0x20dbcf0>,
  ('is_unread', <class 'sqlalchemy.types.Boolean'>),
...

account

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

account_id

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

conv

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

conv_id

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

date

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

from_

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

from_email

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

from_name

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

is_deleted

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

is_unread

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

msg_id

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

payload

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

subject

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

table

Value:
Table('msg',MetaData(),Column('id',Integer(),primary_key=True,nullable\
=False),Column('is_deleted',Boolean(),nullable=False,default=ColumnDef\
ault(False)),Column('is_unread',Boolean(),nullable=False,default=Colum\
nDefault(True)),Column('msg_id',Unicode(length=200)),Column('payload',\
BLOB(length=None),nullable=False),Column('subject',Unicode(length=None\
)),Column('from_',Unicode(length=None)),Column('from_name',Unicode(len\
gth=None)),Column('from_email',Unicode(length=None)),Column('to_',Unic\
ode(length=None),key='to'),Column('cc',Unicode(length=None)),Column('d\
...