diff options
Diffstat (limited to 'src/mailman/model/uid.py')
| -rw-r--r-- | src/mailman/model/uid.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/mailman/model/uid.py b/src/mailman/model/uid.py index c60d0f1eb..72ddd7b5a 100644 --- a/src/mailman/model/uid.py +++ b/src/mailman/model/uid.py @@ -25,11 +25,12 @@ __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.transaction import dbconnection +from mailman.database.types import UUID @@ -45,8 +46,11 @@ 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, index=True) @dbconnection def __init__(self, store, uid): @@ -70,7 +74,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) |
