Exemplo n.º 1
0
 def test_heirarchy_two_levels(self):
     treestr = '{"$and": [{"reading": {"$gte": 0}}, {"teaching_or_training": {"$gte": 0}}, {"$or": [{"research": {"$gte": 0}}, {"eating": {"$gte": 0}}]}]}'
     tree = json.loads(treestr)
     print tree
     qt = QueryTree(tree, debug=True)
     print "Result = ", qt.sql()
Exemplo n.º 2
0
 def test_heirarchy_and(self):
     treestr = '{"$and": [{"reading": {"$gte": 0}}, {"teaching_or_training": {"$gte": 0}}]}'
     tree = json.loads(treestr)
     qt = QueryTree(tree)
     print qt.sql()