diff options
| author | Barry Warsaw | 2011-08-30 22:04:14 -0400 |
|---|---|---|
| committer | Barry Warsaw | 2011-08-30 22:04:14 -0400 |
| commit | 232ac1d8af1b6d483a1bd7aa2bc5ae15e0450bdf (patch) | |
| tree | e1e0b843a849bfaccf2d006d9ee1340a99a1eee1 /src/mailman/rest/lists.py | |
| parent | 0664713d4f7e30b0b56b1ce00ccf3367f416c901 (diff) | |
| parent | d1404b057df7f7ce20df7dac13eb18eba4eb02b4 (diff) | |
| download | mailman-232ac1d8af1b6d483a1bd7aa2bc5ae15e0450bdf.tar.gz mailman-232ac1d8af1b6d483a1bd7aa2bc5ae15e0450bdf.tar.zst mailman-232ac1d8af1b6d483a1bd7aa2bc5ae15e0450bdf.zip | |
Diffstat (limited to 'src/mailman/rest/lists.py')
| -rw-r--r-- | src/mailman/rest/lists.py | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/mailman/rest/lists.py b/src/mailman/rest/lists.py index 2c2f58da1..6a6388320 100644 --- a/src/mailman/rest/lists.py +++ b/src/mailman/rest/lists.py @@ -24,6 +24,7 @@ __all__ = [ 'AList', 'AllLists', 'ListConfiguration', + 'ListsForDomain', ] @@ -207,4 +208,20 @@ class MembersOfList(MemberCollection): roster = self._mlist.get_roster(self._role) address_of_member = attrgetter('address.email') return list(sorted(roster.members, key=address_of_member)) - + + +class ListsForDomain(_ListBase): + """The mailing lists for a particular domain.""" + + def __init__(self, domain): + self._domain = domain + + @resource.GET() + def collection(self, request): + """/domains/<domain>/lists""" + resource = self._make_collection(request) + return http.ok([], etag(resource)) + + def _get_collection(self, request): + """See `CollectionMixin`.""" + return list(self._domain.mailing_lists) |
