Created
November 5, 2018 05:59
-
-
Save jordic/124fc679ce57dde41c8000ee77f0c23f to your computer and use it in GitHub Desktop.
configure
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from plone.rest.zcml import serviceDirective | |
| class service(_base_decorator): | |
| def __call__(self, klass): | |
| global context | |
| method = self.config.get('method', 'GET') | |
| accept = self.config.get('accept', u"application/json") | |
| permission = self.config.pop('permission', 'zope2.View') | |
| for_ = self.config.pop("for_", Interface) | |
| serviceDirective( | |
| context, method, accept, klass, for_, | |
| permission, | |
| **self.config | |
| ) | |
| return klass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment