diff options
| author | Barry Warsaw | 2014-09-21 16:07:40 -0400 |
|---|---|---|
| committer | Barry Warsaw | 2014-09-21 16:07:40 -0400 |
| commit | 0ad6dc0bf9f69f8245693b86ed2715effebf1fb3 (patch) | |
| tree | 2dc0359dc7c3a043c87a92697c5de7ef2b0ddee3 /src/mailman/model/uid.py | |
| parent | b6bc505e45a2f1f4f99d7dd2cdd868d533270ee9 (diff) | |
| parent | c339f06cca6ddf1d28cde2614a94c2a0c905957a (diff) | |
| download | mailman-0ad6dc0bf9f69f8245693b86ed2715effebf1fb3.tar.gz mailman-0ad6dc0bf9f69f8245693b86ed2715effebf1fb3.tar.zst mailman-0ad6dc0bf9f69f8245693b86ed2715effebf1fb3.zip | |
Merge Abilash's branch
Diffstat (limited to 'src/mailman/model/uid.py')
| -rw-r--r-- | src/mailman/model/uid.py | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/mailman/model/uid.py b/src/mailman/model/uid.py index c60d0f1eb..77f1b59bb 100644 --- a/src/mailman/model/uid.py +++ b/src/mailman/model/uid.py @@ -25,10 +25,11 @@ __all__ = [ ] -from storm.locals import Int -from storm.properties import UUID + +from sqlalchemy import Column, Integer from mailman.database.model import Model +from mailman.database.types import UUID from mailman.database.transaction import dbconnection @@ -45,12 +46,14 @@ class UID(Model): There is no interface for this class, because it's purely an internal implementation detail. """ - id = Int(primary=True) - uid = UUID() + + __tablename__ = 'uid' + + id = Column(Integer, primary_key=True) + uid = Column(UUID) @dbconnection def __init__(self, store, uid): - super(UID, self).__init__() self.uid = uid store.add(self) @@ -70,7 +73,7 @@ class UID(Model): :type uid: unicode :raises ValueError: if the id is not unique. """ - existing = store.find(UID, uid=uid) + existing = store.query(UID).filter_by(uid=uid) if existing.count() != 0: raise ValueError(uid) return UID(uid) |
