@@ -217,7 +214,7 @@ class NodesChildrenDuplicates(APIView):
classNodesChildrenMetatadata(APIView):
defget(self,request,node_id):
# query hyperdata keys
ParentNode=aliased(Node)
hyperdata_query=(session
...
...
@@ -278,7 +275,7 @@ class NodesChildrenMetatadata(APIView):
classNodesChildrenQueries(APIView):
def_parse_filter(self,filter):
# validate filter keys
filter_keys={'field','operator','value'}
ifset(filter)!=filter_keys:
...
...
@@ -378,7 +375,7 @@ 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('Invalid key for "%s" in parameter "field", should be one of the following values: "%s". "%s" was found instead'%(field[0],'", "'.join(hyperdata_names),field[1]),400)
raiseAPIException('Invalid key for "%s" in parameter "field", should be one of the following values: "%s". "%s" was found instead'%(field[0],'", "'.join(hyperdata_names),field[1]),400)
# check or create Node_Hyperdata alias; join if necessary
ifhyperdata.idinhyperdata_aliases:
hyperdata_alias=hyperdata_aliases[hyperdata.id]
...
...
@@ -480,7 +477,7 @@ class NodesChildrenQueries(APIView):
getattr(hyperdata_alias,'value_'+hyperdata.type),
value
))
eliffield[0]=='ngrams':
eliffield[0]=='ngrams':
query=query.filter(
Node.id.in_(session
.query(Node_Ngram.node_id)
...
...
@@ -597,17 +594,17 @@ class Nodes(APIView):
# it should take the subnodes into account as well,