[Mailman-Developers] Storm based MemberAdaptor for Mailman

Malveeka Tewari malveeka at gmail.com
Sat Aug 8 10:25:58 CEST 2009


Hi all

I am working on writing a storm based member adaptor for mailman so that the
mailman membership data can be stored in a database instead of .pck files.
The reason for choosing storm is that it provides an abstraction to use any
underlying db language- either mysql, postgresql or sqllite.

I have created a branch on launchpad for this adaptor and would be great if
I can get a code review of the adaptor ,t he schema of the db that I am
using for storing memberships data and an opinion of whether such a member
adaptor is desired at all. Presently the storm adaptor is written for
Postgresql but it will  support mysql and sqllite with slight modifications.

Please take a look at *Mailman/PgsqlMemberships.py* at *
https://code.launchpad.net/~malveeka/+junk/StormMemberAdaptor* under the
first revision.

The work is under progress and for now, I using to storm to create a
database with memberships data alongwith the pickle files. The
Mailman/PgsqlMemberships.py subclasses OldStyleMemberships.py and still uses
the accessor methods in OldStyleMemberships instead of accessing the data
from the postgres db.

The ideal case would be to use only a database and no pickle files for
Memberships data but I have not reached there.
I had tried to read and use  the data from the database instead of pickle
files and that had broken my Mailman  which leaves me with  few questions

In OldStyleMemberships.py the lower cased email address is used as a key for
accessing the membership properties.
However in my schema, I am using the (listname, case preserved email
address) as the PK.
Is it possible that not storing and using  LCE as a key might break
something.

I also want to make sure that in the database I am caturing all the
Memberships data. Presently my database uses the following class as a storm
abstraction for the database. Do I need to add/remove anything?

class PgsqlMembers(object):
    __storm_table__ = "mailman_test"
    __storm_primary__ =  "listname","address"

    listname = Unicode()
    address = Unicode()
    password = Unicode()
    lang = Unicode()
    name = Unicode()
    digest = Unicode()
    delivery_status = Int()
    user_options = Int()
    topics_userinterest = Unicode()
    bounce_info = Unicode()
    delivery_status_timestamp = Unicode()


Looking forward to your reviews and finally getting the thing in place!!

Thanks a lot all
Malveeka


More information about the Mailman-Developers mailing list