From 0265a93b24f2061d765d8f3eb0fc27c9fd080510 Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Tue, 28 Jun 2016 06:36:02 -0400 Subject: 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. --- src/mailman/interfaces/api.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/mailman/interfaces/api.py') 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. -- cgit v1.2.3-70-g09d2