diff options
| author | Barry Warsaw | 2016-07-29 19:28:46 -0400 |
|---|---|---|
| committer | Barry Warsaw | 2016-07-29 19:28:46 -0400 |
| commit | febb5289e82c4424cdbcc2297e967bd894cbc8cf (patch) | |
| tree | bd71f4cbf6988049ac4d5dd65ceb7d5cc51902e7 /src/mailman/model/pending.py | |
| parent | 90e84bee5f47cbcdb9e9c367c60a877e325ef3e7 (diff) | |
| download | mailman-febb5289e82c4424cdbcc2297e967bd894cbc8cf.tar.gz mailman-febb5289e82c4424cdbcc2297e967bd894cbc8cf.tar.zst mailman-febb5289e82c4424cdbcc2297e967bd894cbc8cf.zip | |
Diffstat (limited to 'src/mailman/model/pending.py')
| -rw-r--r-- | src/mailman/model/pending.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/mailman/model/pending.py b/src/mailman/model/pending.py index 0e19f0cbf..9d8315605 100644 --- a/src/mailman/model/pending.py +++ b/src/mailman/model/pending.py @@ -24,11 +24,12 @@ from mailman import public from mailman.config import config from mailman.database.model import Model from mailman.database.transaction import dbconnection +from mailman.database.types import SAUnicode from mailman.interfaces.pending import ( IPendable, IPended, IPendedKeyValue, IPendings) from mailman.utilities.datetime import now from mailman.utilities.uid import TokenFactory -from sqlalchemy import Column, DateTime, ForeignKey, Integer, Unicode, and_ +from sqlalchemy import Column, DateTime, ForeignKey, Integer, and_ from sqlalchemy.orm import aliased, relationship from zope.interface import implementer from zope.interface.verify import verifyObject @@ -45,8 +46,8 @@ class PendedKeyValue(Model): __tablename__ = 'pendedkeyvalue' id = Column(Integer, primary_key=True) - key = Column(Unicode, index=True) - value = Column(Unicode, index=True) + key = Column(SAUnicode, index=True) + value = Column(SAUnicode, index=True) pended_id = Column(Integer, ForeignKey('pended.id'), index=True) def __init__(self, key, value): @@ -62,9 +63,9 @@ class Pended(Model): __tablename__ = 'pended' id = Column(Integer, primary_key=True) - token = Column(Unicode, index=True) + token = Column(SAUnicode, index=True) expiration_date = Column(DateTime, index=True) - key_values = relationship('PendedKeyValue', cascade="all, delete-orphan") + key_values = relationship('PendedKeyValue', cascade='all, delete-orphan') @public |
