diff options
author | Aurélien Bompard <aurelien@bompard.org> | 2013-02-04 12:08:26 +0100 |
---|---|---|
committer | Aurélien Bompard <aurelien@bompard.org> | 2013-02-04 12:13:49 +0100 |
commit | 29f188a48d909badf29cbda3b65f751434bde002 (patch) | |
tree | 300144dad33c5d899989c220eea5067d5dcf74ae /kittystore | |
parent | 416b12c0380b819266b19fd37e864fe1e43af9fc (diff) | |
download | kittystore-29f188a48d909badf29cbda3b65f751434bde002.tar.gz kittystore-29f188a48d909badf29cbda3b65f751434bde002.tar.xz kittystore-29f188a48d909badf29cbda3b65f751434bde002.zip |
Import the list description from Mailman
Diffstat (limited to 'kittystore')
-rw-r--r-- | kittystore/storm/model.py | 1 | ||||
-rw-r--r-- | kittystore/storm/schema/__init__.py | 3 | ||||
-rw-r--r-- | kittystore/storm/schema/patch_6.py | 6 | ||||
-rw-r--r-- | kittystore/storm/store.py | 8 |
4 files changed, 18 insertions, 0 deletions
diff --git a/kittystore/storm/model.py b/kittystore/storm/model.py index 74524ed..c4b66d0 100644 --- a/kittystore/storm/model.py +++ b/kittystore/storm/model.py @@ -47,6 +47,7 @@ class List(Storm): name = Unicode(primary=True) display_name = Unicode() + description = Unicode() def __init__(self, name): self.name = unicode(name) diff --git a/kittystore/storm/schema/__init__.py b/kittystore/storm/schema/__init__.py index eebae1c..d73a49e 100644 --- a/kittystore/storm/schema/__init__.py +++ b/kittystore/storm/schema/__init__.py @@ -7,6 +7,7 @@ CREATES = { CREATE TABLE "list" ( name VARCHAR(255) NOT NULL, display_name TEXT, + description TEXT, PRIMARY KEY (name) );""", """ CREATE TABLE "thread" ( @@ -68,6 +69,7 @@ CREATES = { CREATE TABLE "list" ( name VARCHAR(255) NOT NULL, display_name TEXT, + description TEXT, PRIMARY KEY (name) );""", """ CREATE TABLE "thread" ( @@ -129,6 +131,7 @@ CREATES = { CREATE TABLE `list` ( name VARCHAR(255) NOT NULL, display_name TEXT, + description TEXT, PRIMARY KEY (name) );""", """ CREATE TABLE `thread` ( diff --git a/kittystore/storm/schema/patch_6.py b/kittystore/storm/schema/patch_6.py new file mode 100644 index 0000000..180e731 --- /dev/null +++ b/kittystore/storm/schema/patch_6.py @@ -0,0 +1,6 @@ +# -*- coding: utf-8 -*- + +def apply(store): + """Add the description column""" + store.execute('ALTER TABLE "list" ADD COLUMN "description" TEXT;') + store.commit() diff --git a/kittystore/storm/store.py b/kittystore/storm/store.py index 7f22009..01c7554 100644 --- a/kittystore/storm/store.py +++ b/kittystore/storm/store.py @@ -90,6 +90,7 @@ class StormStore(object): l = List(list_name) self.db.add(l) l.display_name = mlist.display_name + l.description = mlist.description if not message.has_key("Message-Id"): raise ValueError("No 'Message-Id' header in email", message) msg_id = unicode(unquote(message['Message-Id'])) @@ -334,6 +335,13 @@ class StormStore(object): """ return list(self.db.find(List.name).order_by(List.name)) + def get_lists(self): + """Return the archived lists. + + :returns: A list containing the archived mailing-lists. + """ + return list(self.db.find(List).order_by(List.name)) + def get_messages(self, list_name, start, end): """ Return all emails between two given dates. |