summaryrefslogtreecommitdiff
path: root/src/django_pgpmailman/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/django_pgpmailman/models.py')
-rw-r--r--src/django_pgpmailman/models.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/django_pgpmailman/models.py b/src/django_pgpmailman/models.py
index 0a49475..572e51b 100644
--- a/src/django_pgpmailman/models.py
+++ b/src/django_pgpmailman/models.py
@@ -20,7 +20,8 @@ from __future__ import absolute_import, unicode_literals
from itertools import chain
-from mailmanclient._client import MailingList, RESTObject
+from mailmanclient import Address, MailingList
+from mailmanclient.restbase.base import RESTObject
from pgpy import PGPKey
from pgpy.errors import PGPError
@@ -32,7 +33,7 @@ class PGPMailingList(RESTObject):
'strip_original_sig', 'sign_outgoing', 'nonencrypted_msg_action',
'encrypt_outgoing', 'key_change_workflow', 'key_signing_allowed')
_read_only_properties = ('self_link', 'list_id')
- _properties = list(chain(_writable_properties, _read_only_properties))
+ _properties = tuple(chain(_writable_properties, _read_only_properties))
@property
def mlist(self):
@@ -68,3 +69,13 @@ class PGPMailingList(RESTObject):
self._connection.call(self._url + '/pubkey',
data=dict(public_key=str_key),
method='PUT')
+
+
+class PGPAddress(RESTObject):
+ _read_only_properties = ('self_link', 'email', 'key_fingerprint',
+ 'key_confirmed')
+ _properties = _read_only_properties
+
+ @property
+ def address(self):
+ return Address(self._connection, 'addresses/{}'.format(self.email))