summaryrefslogtreecommitdiff
path: root/src/mailman/interfaces/api.py
diff options
context:
space:
mode:
authorBarry Warsaw2016-06-28 06:36:02 -0400
committerBarry Warsaw2016-06-28 06:36:02 -0400
commit0265a93b24f2061d765d8f3eb0fc27c9fd080510 (patch)
tree996cf5051ddd0144cea90336bbde6ef7c6ef700a /src/mailman/interfaces/api.py
parentc71417b39bc9832b71f766e525a08addda6166cd (diff)
downloadmailman-0265a93b24f2061d765d8f3eb0fc27c9fd080510.tar.gz
mailman-0265a93b24f2061d765d8f3eb0fc27c9fd080510.tar.zst
mailman-0265a93b24f2061d765d8f3eb0fc27c9fd080510.zip
Better handling of the REST API plumbing.
* Add a version_info field which is a better way to do ordered comparisions of the API version. * All subresources now get their .api attribute set automatically, if they are passed back through the ObjectRouter. No more fiddling with context['api'] (unless of course, they don't make a roundtrip through the main ObjectRouter loop.
Diffstat (limited to 'src/mailman/interfaces/api.py')
-rw-r--r--src/mailman/interfaces/api.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/mailman/interfaces/api.py b/src/mailman/interfaces/api.py
index 8096f40eb..3ba158b35 100644
--- a/src/mailman/interfaces/api.py
+++ b/src/mailman/interfaces/api.py
@@ -25,7 +25,11 @@ from zope.interface import Attribute, Interface
class IAPI(Interface):
"""The REST web service context."""
- version = Attribute("""The REST API version.""")
+ version = Attribute(
+ """The REST API version as a string.""")
+
+ version_info = Attribute(
+ """The REST API version as a tuple of integers.""")
def path_to(resource):
"""Return the full REST URL to the given resource.