aboutsummaryrefslogtreecommitdiff
path: root/src/mailman_pgp/model
diff options
context:
space:
mode:
authorJ08nY2017-06-15 23:23:19 +0200
committerJ08nY2017-06-15 23:23:19 +0200
commitb86dbc83db1f85146ec48866b6ada4f1bb8d41c0 (patch)
treea290124e75e283d88c75a5cb87d8d217385c0e2f /src/mailman_pgp/model
parentc649aa7e8102899e2018242f68860ae350af3905 (diff)
downloadmailman-pgp-b86dbc83db1f85146ec48866b6ada4f1bb8d41c0.tar.gz
mailman-pgp-b86dbc83db1f85146ec48866b6ada4f1bb8d41c0.tar.zst
mailman-pgp-b86dbc83db1f85146ec48866b6ada4f1bb8d41c0.zip
Diffstat (limited to 'src/mailman_pgp/model')
-rw-r--r--src/mailman_pgp/model/address.py25
-rw-r--r--src/mailman_pgp/model/list.py10
2 files changed, 34 insertions, 1 deletions
diff --git a/src/mailman_pgp/model/address.py b/src/mailman_pgp/model/address.py
index e69de29..040e532 100644
--- a/src/mailman_pgp/model/address.py
+++ b/src/mailman_pgp/model/address.py
@@ -0,0 +1,25 @@
+""""""
+
+from mailman.database.types import SAUnicode
+from sqlalchemy import Column, Integer
+
+from mailman_pgp.model.base import Base
+
+
+class EncryptedAddress(Base):
+ __tablename__ = 'encrypted_addresses'
+
+ id = Column(Integer, primary_key=True)
+ email = Column(SAUnicode, index=True)
+ key_fingerprint = Column(SAUnicode)
+
+ def __init__(self, email):
+ super().__init__()
+ self.email = email
+ self._user_key = None
+
+ @property
+ def user_key(self):
+ if self._user_key is not None:
+ return self._user_key
+ pass
diff --git a/src/mailman_pgp/model/list.py b/src/mailman_pgp/model/list.py
index f781a9a..d6384af 100644
--- a/src/mailman_pgp/model/list.py
+++ b/src/mailman_pgp/model/list.py
@@ -13,7 +13,7 @@ class EncryptedMailingList(Base):
__tablename__ = 'encrypted_lists'
id = Column(Integer, primary_key=True)
- list_id = Column(SAUnicode)
+ list_id = Column(SAUnicode, index=True)
key_fingerprint = Column(SAUnicode)
unsigned_msg_action = Column(Enum(Action))
nonencrypted_msg_action = Column(Enum(Action))
@@ -21,4 +21,12 @@ class EncryptedMailingList(Base):
sign_outgoing = Column(Boolean)
def __init__(self, mlist):
+ super().__init__()
self.list_id = mlist.list_id
+ self._list_key = None
+
+ @property
+ def list_key(self):
+ if self._list_key is not None:
+ return self._list_key
+ pass