~barry/mailman/templatecache

« back to all changes in this revision

Viewing changes to src/mailman/interfaces/requests.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:
26
26
__metaclass__ = type
27
27
__all__ = [
28
28
    'IListRequests',
29
 
    'IRequests',
30
29
    'RequestType',
31
30
    ]
32
31
 
87
86
         Only items with a matching `type' are returned.
88
87
         """
89
88
 
90
 
    def get_request(request_id):
 
89
    def get_request(request_id, request_type):
91
90
        """Get the data associated with the request id, or None.
92
91
 
93
92
        :param request_id: The unique id for the request.
 
93
        :type request_id: int
 
94
        :param request_type: Optional request type that the requested id must
 
95
            match, otherwise no match is returned.
 
96
        :type request_type: `RequestType`
94
97
        :return: A 2-tuple of the key and data originally held, or None if the
95
98
            `request_id` is not in the database.
96
99
        """
101
104
        :param request_id: The unique id for the request.
102
105
        :raises KeyError: If `request_id` is not in the database.
103
106
        """
104
 
 
105
 
 
106
 
 
107
 
class IRequests(Interface):
108
 
    """The requests database."""
109
 
 
110
 
    def get_list_requests(mailing_list):
111
 
        """Return the `IListRequests` object for the given mailing list.
112
 
 
113
 
        :param mailing_list: An `IMailingList`.
114
 
        :return: An `IListRequests` object for the mailing list.
115
 
        """