Author: barry.warsaw
Date: Sat Mar 19 19:32:41 2005
New Revision: 35
Modified:
trunk/mailman/src/mailman/database/schema.py
Log:
Flesh out more tables, although they are not yet tested.
Modified: trunk/mailman/src/mailman/database/schema.py
==============================================================================
--- trunk/mailman/src/mailman/database/schema.py (original)
+++ trunk/mailman/src/mailman/database/schema.py Sat Mar 19 19:32:41 2005
@@ -18,6 +18,7 @@
import sys
import logging
+import datetime
from sqlobject import *
from sqlobject.inheritance import InheritableSQLObject
@@ -30,23 +31,33 @@
class MailingList(SQLObject):
_cacheValue = False
# Attributes
- name = UnicodeCol() # human readable name of list
- description = UnicodeCol() # long descrip of list (opt)
- owners = ForeignKey('Roster') # id of roster of owners
- moderators = ForeignKey('Roster') # id of moderators (opt)
- creation_date = DateTimeCol() # when was the list created
- domain = ForeignKey('Domain') # info about the list's domain
- members = ForeignKey('Roster') # id of roster of list members
+ name = UnicodeCol()
+ description = ForeignKey('CachedLanguageText', default=None)
+ owners = ForeignKey('Roster')
+ moderators = ForeignKey('Roster')
+ creation_date = DateTimeCol(default=datetime.datetime.now)
+ domain = ForeignKey('Domain')
+ members = ForeignKey('Roster')
+ post_response = ForeignKey('Autoresponse', default=None)
+ owner_response = ForeignKey('Autoresponse', default=None)
+ request_response = ForeignKey('Autoresponse', default=None)
+ archives = ForeignKey('MessageCollection')
+ owner_archives = ForeignKey('MessageCollection')
class Domain(SQLObject):
_cacheValue = False
# Attributes
- mailhost = UnicodeCol() # hostname of mail server
- webhost = UnicodeCol() # hostname of web server
- newshost = UnicodeCol() # hostname of news server
- imaphost = UnicodeCol() # hostname of imap server
+ mailhost = UnicodeCol()
+ webhost = UnicodeCol(default=None)
+ newshost = UnicodeCol(default=None)
+ imaphost = UnicodeCol(default=None)
+ admins = ForeignKey('Roster')
+
+
+
+class SiteInformation(SQLObject):
admins = ForeignKey('Roster')
@@ -68,14 +79,13 @@
_cacheValue = False
_inheritable = False
# Attributes
- address = UnicodeCol(default=None)
- priority = IntCol(default=None)
- # member_id
- is_verified = BoolCol(default=None)
- # preference_id
+ address = UnicodeCol()
+ #priority = IntCol(default=None)
+ #member_id
+ #preference_id
label = UnicodeCol(default=None)
realname = UnicodeCol(default=None)
- registration_date = DateTimeCol(default=None)
+ registration_date = DateTimeCol(default=datetime.datetime.now)
verification_date = DateTimeCol(default=None)
@@ -84,6 +94,67 @@
_inheritable = False
# Attributes
roster = ForeignKey('Roster')
+
+
+
+class Autoresponse(SQLObject):
+ _cacheValue = False
+ # Attributes
+ graceperiod = IntCol(default=90*24*60*60) # seconds, FIXME
+ response_text = ForeignKey('CachedLanguageText')
+
+
+class CachedLanguageText(SQLObject):
+ _cacheValue = False
+ # Attributes
+ for_language = UnicodeCol()
+ url = UnicodeCol()
+ last_cached = DateTimeCol(default=None)
+ cache_lifetime = IntCol(default=60*60) # seconds, FIXME
+ text = UnicodeCol(default=None)
+
+
+
+class BounceInfo(SQLObject):
+ _cacheValue = False
+ # Attributes
+ score = IntCol(default=0)
+ last_bounce_date = DateTimeCol(default=None)
+ notices_left = IntCol(default=None)
+ last_notice_date = DateTimeCol(default=None)
+ reenable_token = UnicodeCol(default=None)
+ collection = ForeignKey('MessageCollection')
+
+
+
+class Version(SQLObject):
+ _cacheValue = False
+ # Attributes
+ component = UnicodeCol(default=None)
+ version = UnicodeCol(default=None)
+ build_number = IntCol(default=None)
+
+
+
+class Message(SQLObject):
+ _cacheValue = False
+ # Message header attributes
+ header_message_id = UnicodeCol(default=None)
+ header_subject = UnicodeCol(default=None)
+ header_from = UnicodeCol(default=None)
+ header_date = UnicodeCol(default=None)
+ header_references = UnicodeCol(default=None)
+ header_in_reply_to = UnicodeCol(default=None)
+ # Internal values
+ received_date = DateTimeCol()
+ content_uri = UnicodeCol()
+ collection = RelatedJoin('MessageCollection')
+
+
+class MessageCollection(SQLObject):
+ _cacheValue = False
+ # Attributes
+ message = RelatedJoin('Message')
_______________________________________________
Mailman-checkins mailing list
[email protected]
Unsubscribe:
http://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org