This package implements a sqlalchemy query builder for json data
generated with (but not limited to) jQuery QueryBuilder
.
Using sqlalchemy-querybuilder is very simple:
from sqlalchemy_querybuilder import Filter
from myapp import models, query
rules = {
"condition": "OR",
"rules": [{
"field": "mytable.myfield",
"operator": "equal",
"value": "foo"
},
],
}
myfilter = Filter(models, query)
print(myfilter.querybuilder(rules))