From 5623b1b06f3200caf01b308c818098bdcd2ff6b2 Mon Sep 17 00:00:00 2001 From: Alexandre Dulaunoy Date: Tue, 24 Dec 2013 16:50:45 +0100 Subject: [PATCH] fquery added to include rdata pivot to ease query search --- bin/qof-server.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/bin/qof-server.py b/bin/qof-server.py index ff51b06..e21c8ee 100644 --- a/bin/qof-server.py +++ b/bin/qof-server.py @@ -106,8 +106,19 @@ class QueryHandler(tornado.web.RequestHandler): else: self.write(JsonQOF(getRecord(t = q.strip()))) +class FullQueryHandler(tornado.web.RequestHandler): + def get(self, q): + print ("fquery: "+q) + if iptools.ipv4.validate_ip(q) or iptools.ipv6.validate_ip(q): + for x in getAssociatedRecords(q): + self.write(JsonQOF(getRecord(x))) + else: + for x in getAssociatedRecords(q): + self.write(JsonQOF(getRecord(t = x.strip()))) + application = tornado.web.Application([ (r"/query/(.*)",QueryHandler), + (r"/fquery/(.*)",FullQueryHandler), (r"/info", InfoHandler) ])