diff options
| author | Abhilash Raj | 2014-09-05 10:45:50 +0530 |
|---|---|---|
| committer | Abhilash Raj | 2014-09-05 10:45:50 +0530 |
| commit | 1341b9f00d56c806b78298f3dad7350d8fa28c39 (patch) | |
| tree | 1e4385f5687535cce09dd53191e615426c1d319e /src/mailman/model/requests.py | |
| parent | d95e634aa7bcf8018797923c1d90fc2eadff8ce9 (diff) | |
| download | mailman-1341b9f00d56c806b78298f3dad7350d8fa28c39.tar.gz mailman-1341b9f00d56c806b78298f3dad7350d8fa28c39.tar.zst mailman-1341b9f00d56c806b78298f3dad7350d8fa28c39.zip | |
Diffstat (limited to 'src/mailman/model/requests.py')
| -rw-r--r-- | src/mailman/model/requests.py | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/mailman/model/requests.py b/src/mailman/model/requests.py index f3ad54797..457341557 100644 --- a/src/mailman/model/requests.py +++ b/src/mailman/model/requests.py @@ -26,7 +26,8 @@ __all__ = [ from cPickle import dumps, loads from datetime import timedelta -from storm.locals import AutoReload, Int, RawStr, Reference, Unicode +from sqlalchemy import Column, Unicode, Integer, ForeignKey +from sqlalchemy.orm import relationship from zope.component import getUtility from zope.interface import implementer @@ -142,13 +143,15 @@ class ListRequests: class _Request(Model): """Table for mailing list hold requests.""" - id = Int(primary=True, default=AutoReload) - key = Unicode() - request_type = Enum(RequestType) - data_hash = RawStr() + __tablename__ == 'request' - mailing_list_id = Int() - mailing_list = Reference(mailing_list_id, 'MailingList.id') + id = Column(Integer, primary_key=True)# TODO: ???, default=AutoReload) + key = Column(Unicode) + request_type = Column(Enum(enum=RequestType)) + data_hash = Column(Unicode) # TODO : was RawStr() + + mailing_list_id = Column(Integer, ForeignKey('mailinglist.id')) + mailing_list = relationship('MailingList') def __init__(self, key, request_type, mailing_list, data_hash): super(_Request, self).__init__() |
