Ejemplo n.º 1
0
Archivo: api.py Proyecto: CYJ/malcom
def evil():
	query = {}
	depth = int(request.args.get('depth', 2))
	if depth > 2: depth = 2

	for key in request.args:
		if key not in ['depth']:
			query[key] = request.args.getlist(key)
	data = Model.multi_graph_find(query, {'key':'tags', 'value': 'evil'})

	return (dumps(data), 200, {'Content-Type': 'application/json'})
Ejemplo n.º 2
0
Archivo: api.py Proyecto: darron/malcom
def evil():
    query = {}
    depth = int(request.args.get('depth', 2))
    if depth > 2: depth = 2

    for key in request.args:
        if key not in ['depth']:
            query[key] = request.args.getlist(key)
    data = Model.multi_graph_find(query, {'key': 'tags', 'value': 'evil'})

    return (dumps(data), 200, {'Content-Type': 'application/json'})
Ejemplo n.º 3
0
    def get(self):
        args = Evil.parser.parse_args()
        query = {}
        depth = args['depth']
        if depth > 2:
            depth = 2

        for key in args:
            if key not in ['depth']:
                query[key] = request.args.getlist(key)

        data = Model.multi_graph_find(query, {'key':'tags', 'value': 'evil'}, depth=depth)
        return data
Ejemplo n.º 4
0
    def get(self):
        args = Evil.parser.parse_args()
        query = {}
        depth = args['depth']
        if depth > 2:
            depth = 2

        for key in args:
            if key not in ['depth']:
                query[key] = request.args.getlist(key)

        data = Model.multi_graph_find(query, {
            'key': 'tags',
            'value': 'evil'
        },
                                      depth=depth)
        return data