# # methods = [name for name in list(vars(cls)) if callable(getattr(cls, name))]
# # return '', 200, {'Allow': ','.join([
# # method.upper()
# # for method in methods
# # if method[0] != '_' and (method not in dir(RestHttpResponse) or method == 'options') and callable(RestHttpResponse, method)
# # ])}
# return '', 200, {'Allow': ','.join([method.upper() for method in dir(self) if method[0] != '_' and method in ['get', 'post', 'put', 'delete', 'options']])}
# delattr(RestHttpResponse, 'get')
fromrest_framework.viewsimportAPIView
fromrest_framework.responseimportResponse
fromrest_framework.exceptionsimportAPIException
...
...
@@ -388,8 +326,12 @@ class NodesChildrenQueries(APIView):
raiseAPIException('In the query\'s "retrieve" parameter, a "list" should be provided as an array',400)
ifretrieve['type']notinretrieve_types:
raiseAPIException('Unrecognized "type": "%s" in the query\'s "retrieve" parameter. Possible values are: "%s".'%(retrieve["type"],'", "'.join(retrieve_types),),400)
raiseAPIException('Unrecognized "type": "%s" in the query\'s "retrieve" parameter. Possible values are: "%s".'%(retrieve['type'],'", "'.join(retrieve_types),),400)
raiseAPIException('Unrecognized "field": "%s" in the query\'s "retrieve" parameter. Possible values are: "%s".'%(field_name,'", "'.join(authorized_field_names),))