DATABASE ABSTRACTIONS

Abstract:

Systers use GNU mailing list manager Mailman2 which currently uses Python pickle files to store its data.Systers moderators have customized it to make use of PostgreySQL database .They make use of raw SQL statements and python db-api which makes the code :

  1. Dependent on the existing database
  2. Reduces the efiiciency and maintainability

The project idea aims at making the code :

  1. Independent of the database by making the use of python classes and objects to interact with the database rather than direct SQL statements.
  2. This will be achieved with the help of an ORM(Object Relational Mapper).Storm will be our choice of ORM
  3. Also, Systers aim at bringing this feature upstream and incorporating this feature in the yet to be released version -Mailman3(which will switch

to use a database) so that the open source world can benefit themselves with the addition of this feature.

Thus,mapping existing schemas of the Systers database to an object oriented paradigm and determination and incorporation of neccesary modifications in the database needs to be done so that it fits cleanly and nicely into Mailman3's Architecture.

Proposed Timeline:

Before April 20:

  1. To familarize myself completely with Mailman2's functionality and architecture.
  2. Study of the customized files of Systers Mailman available in the Launchpad Baazar version control.
  3. To familarize myself with Storm(ORM that we will be using)

1st MILESTONE COMPLETED

April 20 – May 23(Before the official coding time):

  1. To do self coding with Storm to improve my further understanding and ease of use with this ORM and database(PostgreySQL)
  2. During this period I will remain in constant touch with my mentor and the Mailman community.I will remain active on IRC and Mailling lists to

discuss and finalize on the modifications(if any) that needs to be on existing schemas and design of new schemas(if needed to fit cleanly with Mailman3's Architecture)

–> Thus with the help of my mentor I will become absolutely clear about my future goals,the final database implementations that need to be done as well as the approach that I will follow to map the schemas to the Object Oriented Paradigm.

2nd MILESTONE COMPLETED

May 23 – June 18(Official coding period starts):

  1. Define all the required Relations(Tables) in my local database using STORM
  2. Define all the corresponding Python Classes and Objects that will store,modify and retreive data in database.
  3. Define all the interactions that Systers perform with their database(virtualize or stimulate all interactions) in STORM that will deal with my

local database.

–> This will help in testing of the proper working of the entire basic code changes that we will later on incorporate in Systers Sourcecode.

3rd MILESTONE COMPLETED

June 18 – July 5:

  1. Bringing about the decided changes in the Relational Schemas of Systers database.
  2. Replacing parts of the above code in their respective places in the Systers sourcecode.(This should not take much time as most of the funtionality has been implemnted in the previous step)
  3. Testing the overall working of each and every module of the modified source code with the help of Python Test Suites.

4th MILESTONE COMPLETED

JULY 6th MID TERM EVALUATION

July 6 – July 15:

  1. Making further changes in the code to improve the Functionality,Exception handling,Bug Removal.

July 15 – July 25:

  1. To be in constant touch with the Mailman3's developers and to let them know about our progress.
  2. Most of the time will be consumed for rigourous testing and bug fixes.

5th MILESTONE COMPLETED

July 25 – July 31st:

  1. For Documentation

6th MILESTONE COMPLETED

A Buffer of two weeks has been kept for any unpredicatable delay.

Classes and their functions in DlistUtils.py

  • Class Subscriber()


  Attributes\\ 
  subscriber_id(serial primary key)\\ 
  mailman_key(varchar,unique)\\ 
  preference(int2)\\ 
  format(int2)\\ 
  deleted(boolean)\\ 


  Functions\\ 
  getSubscriber_id_raw()\\ 
  getSubscriber_id_raw_or_die()\\ 
  getSubscriber_id()\\ 
  changePreferences()\\ 
  change_format()\\ 
  get_format()\\ 


  • CLass Message


  Attributes\\ 
  message_id(serial primary key)\\ 
  sender_id(int references subscriber)\\ 
  subject(varchar)\\ 
  thread_id(int2)\\ 


  Functions\\ 
  createMessage()\\ 


  • Class Thread

Attributes

  thread_id(serial primary key)\\ 
  thread_name(char)\\ 
  base_message_id(Int referencing message)\\ 
  status(int)\\ 
  parent(int)\\ 


  Functions\\ 
  createthread()\\ 
  newthread()\\ 
  continuethread()\\ 
  threadIDandName()\\ 
  specialize_and_inject()\\  
  alphanumericOnly()\\ 
  subjectToName()\\ 


  • Class Override

Attributes

  subscriber_id(int references Subscriber)\\ 
  thread_id(int not NULL references Thread)\\ 
  preference(int2 not NULL)\\ 


  Functions\\ 
  subscribeTothread()\\ 
  unsubscribeFromThread()\\ 
  override_from_web()\\ 
  override_inner()\\ 
  overrideURL()\\ 


  • Class Aliases

Attributes

  pseudonym(primaty)\\ 
  subscriber_id(int references Subscriber)\\ 


  Functions\\ 
  canonicalize_sender()\\ 
  get_aliases()\\ 
  change_aliases()\\ 


**Independent Functions**


createDlist()
UnsubscribeFromLIst()
set_disable()
set_digest()
changeAddress()
mergeSubscribers()
enabled()
setFooterText()

===

 
orm_database_abstraction.txt · Last modified: 2009/06/08 10:08 by kanika
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki