~nherriot/bcm/tags

4 by andrewbird
Create tag Create tag bcm-2.99.10-beta1
1
===============
2
SMS persistence
3
===============
4
5
Overview
6
========
7
8
One of the goals of the BMC/wader merge was to create a contacts and SMS
9
persistence layer to store data on a medium with better characteristics
10
than a plain SIM. `SQLite`_ was chosen because of its small footprint,
11
the fact that has been included with Python since 2.5 and that it was
12
already used in other parts of the system.
13
14
.. _SQLite: http://www.sqlite.org/
15
16
SMS classes overview
17
====================
18
19
A :class:`~wader.common.provider.Message` is always part of a
20
:class:`~wader.common.provider.Thread`, and a thread always belongs to
21
a :class:`~wader.common.provider.Folder`. The central point to perform
22
operations on this three classes is the
23
:class:`~wader.common.provider.SmsProvider`.
24
25
Every conversation with your contacts is stored in a `Thread`. There can
26
only be one thread for a number in a given folder, if a `Message` is
27
moved to a folder and no thread exists for that number it will be
28
automatically created and the message will be associated to it.
29
30
.. image:: images/sms-persistence/relationships.png
31
   :alt: Relationships between classes
32
   :align: center
33
34
Similarly, if a `Message` is moved to a `Folder` and a `Thread` already
35
exists for the message's number, it will be associated to it.
36
37
There are three folders by default: Inbox, Outbox and Drafts. This three
38
folders can not be deleted by design. The user can add as many folders as
39
she desires, but those initial three shall not be deleted.
40
41
.. _CRUD: http://en.wikipedia.org/wiki/Create,_read,_update_and_delete
42