summaryrefslogtreecommitdiff
path: root/src/mailman/model/uid.py
diff options
context:
space:
mode:
authorBarry Warsaw2014-11-02 14:55:10 -0500
committerBarry Warsaw2014-11-02 14:55:10 -0500
commitdfc451f81ccc8b0947fb3fa42e94c55026984cf8 (patch)
treec9834271a2dc7fd7d998e5dd211a0ef047f8085e /src/mailman/model/uid.py
parent0b1ee6fc8d224291c68c964a1af6b481921a13b3 (diff)
parent1d9f6970b9a26ee576838b53f485b96365e3a6c2 (diff)
downloadmailman-dfc451f81ccc8b0947fb3fa42e94c55026984cf8.tar.gz
mailman-dfc451f81ccc8b0947fb3fa42e94c55026984cf8.tar.zst
mailman-dfc451f81ccc8b0947fb3fa42e94c55026984cf8.zip
Diffstat (limited to 'src/mailman/model/uid.py')
-rw-r--r--src/mailman/model/uid.py14
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)