diff options
| author | J08nY | 2017-06-15 23:23:19 +0200 |
|---|---|---|
| committer | J08nY | 2017-06-15 23:23:19 +0200 |
| commit | b86dbc83db1f85146ec48866b6ada4f1bb8d41c0 (patch) | |
| tree | a290124e75e283d88c75a5cb87d8d217385c0e2f /src/mailman_pgp/model | |
| parent | c649aa7e8102899e2018242f68860ae350af3905 (diff) | |
| download | mailman-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.py | 25 | ||||
| -rw-r--r-- | src/mailman_pgp/model/list.py | 10 |
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 |
