~barry/mailman/templatecache

« back to all changes in this revision

Viewing changes to src/mailman/rest/lists.py

  • Committer: Barry Warsaw
  • Date: 2012-01-30 15:37:16 UTC
  • Revision ID: barry@list.org-20120130153716-s9qx07i6i0rltyax
 * Held messages can now be moderated through the REST API.  Mailing list
   resources now accept a `held` path component.  GETing this returns all held
   messages for the mailing list.  POSTing to a specific request id under this
   url can dispose of the message using `Action` enums.
 * `IRequests` interface is removed.  Now just use adaptation from
   `IListRequests` directly (which takes an `IMailingList` object).
 * `handle_message()` now allows for `Action.hold` which is synonymous with
   `Action.defer` (since the message is already being held).
 * `IListRequests.get_request()` now takes an optional `request_type`
   argument to narrow the search for the given request.

- also, print_function is now a standard __future__ import.  The template has
  been updated, but add this to modules as you edit them.

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
from mailman.rest.helpers import (
43
43
    CollectionMixin, etag, no_content, path_to, restish_matcher)
44
44
from mailman.rest.members import AMember, MemberCollection
 
45
from mailman.rest.moderation import HeldMessages
45
46
from mailman.rest.validator import Validator
46
47
 
47
48
 
166
167
            return http.not_found()
167
168
        return ListConfiguration(self._mlist, attribute)
168
169
 
 
170
    @resource.child()
 
171
    def held(self, request, segments):
 
172
        """Return a list of held messages for the mailign list."""
 
173
        if self._mlist is None:
 
174
            return http.not_found()
 
175
        return HeldMessages(self._mlist)
 
176
 
169
177
 
170
178
 
171
179
class AllLists(_ListBase):