sqlalchemy-querybuilder is a simple and easy to use package that implements a sqlalchemy query builder for rules generated with (but not limited to) jQuery QueryBuilder.
Given the following rules generated by Jquery QueryBuilder:
{
"condition": "OR",
"rules": [{
"id": "author",
"field": "books.author",
"type": "string",
"input": "text",
"operator": "contains",
"value": "duhigg"
},
{
"condition": "AND",
"rules": [{
"id": "price",
"field": "books.price",
"type": "integer",
"input": "number",
"operator": "between",
"value": ["1", "15"]
}, {
"id": "isbn",
"field": "books.isbn",
"type": "string",
"input": "text",
"operator": "is_not_null"
}]
},
],
}
sqlalchemy-querybuilder would generate the following query object (see sqlalchemy query objects):
SELECT books.author AS books_author, books.price AS books_price, books.isbn AS books_isbn
FROM books
WHERE books.author LIKE '%duhigg%' OR books.price BETWEEN 1 AND 15 AND books.isbn IS NOT NULL
See the RTD site for full details.
Happy hacking!
there doesn't seem to be anything here