-
Notifications
You must be signed in to change notification settings - Fork 192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added method_decorators into rest api resources #991
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Anyhow, so in the end these are really all the changes we need in aiida?
Very nice!
@@ -192,6 +193,7 @@ def __init__(self, **kwargs): | |||
self.utils_confs = {k: kwargs[k] for k in utils_conf_keys if k in | |||
kwargs} | |||
self.utils = Utils(**self.utils_confs) | |||
self.method_decorators = {'get': kwargs.get('get_decorators', [])} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, so is there a good reason why Node does not inherit from BaseResource?
The explanation below "class Node(Resource)" is not entirely clear to me, perhaps you could make it a docstring and expand it a little bit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NodeResource class is different from BaseResource in trans.set_query() mostly because it takes query_type as an input and the presence of additional result types like "tree". I have updated the doc string.
aiida/restapi/api.py
Outdated
@@ -336,3 +335,4 @@ def handle_error(self, e): | |||
|
|||
else: | |||
raise e | |||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want to comment the function, please use # (don't make it a string).
Also, is there a better alternative to commenting it? Do we want to get rid of it or not?
…. This is now in the optional requirements. also update command-line for verdi data structure import using the qeinputparser
method_decorators keyword argument is added into rest api resources to pass the list of decorators to apply on endpoints