diff options
| author | Barry Warsaw | 2007-09-09 13:22:27 -0400 |
|---|---|---|
| committer | Barry Warsaw | 2007-09-09 13:22:27 -0400 |
| commit | f1df4e6e79e7ba49ec0638fa4dd867b4043254f3 (patch) | |
| tree | 7240ead35f058b7abf4caf2b34f3b32813c1b72d /Mailman/interfaces/requests.py | |
| parent | 3fe9a220e8952853e51dbca359196d1f11dcbdc3 (diff) | |
| download | mailman-f1df4e6e79e7ba49ec0638fa4dd867b4043254f3.tar.gz mailman-f1df4e6e79e7ba49ec0638fa4dd867b4043254f3.tar.zst mailman-f1df4e6e79e7ba49ec0638fa4dd867b4043254f3.zip | |
Diffstat (limited to 'Mailman/interfaces/requests.py')
| -rw-r--r-- | Mailman/interfaces/requests.py | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/Mailman/interfaces/requests.py b/Mailman/interfaces/requests.py index 0a817d43c..b4b5902af 100644 --- a/Mailman/interfaces/requests.py +++ b/Mailman/interfaces/requests.py @@ -42,10 +42,17 @@ class IListRequests(Interface): count = Attribute( """The total number of requests held for the mailing list.""") + def count_of(request_type): + """The total number of requests held of the given request type. + + :param request_type: A `RequestType` enum value. + :return: An integer. + """ + def hold_request(request_type, key, data=None): """Hold some data for moderator approval. - :param request_type: A `Request` enum value. + :param request_type: A `RequestType` enum value. :param key: The key piece of request data being held. :param data: Additional optional data in the form of a dictionary that is associated with the held request. @@ -53,12 +60,23 @@ class IListRequests(Interface): """ held_requests = Attribute( - """An iterator over the held requests, yielding a 2-tuple. + """An iterator over the held requests. - The tuple has the form: (id, type) where `id` is the held request's - unique id and the `type` is a `Request` enum value. + Returned items have two attributes: + * `id` is the held request's unique id; + * `type` is a `RequestType` enum value. """) + def of_type(request_type): + """An iterator over the held requests of the given type. + + Returned items have two attributes: + * `id` is the held request's unique id; + * `type` is a `RequestType` enum value. + + Only items with a matching `type' are returned. + """ + def get_request(request_id): """Get the data associated with the request id, or None. |
