Initial release.
The following operator are supported:
| support | operators | name | code |
|:-------:|:----------|:---------------------:|-------------------:|
| [x] | eq | equal | operators.eq |
| [x] | not_eq | not equal | operators.ne |
| [x] | null | null | is None |
| [x] | not_null | not null | is not None |
| [x] | gt | greater than | operators.gt |
| [x] | gte | greater than or equal | operators.ge |
| [x] | lt | lower than | operators.lt |
| [x] | lte | lower than or equal | operators.le |
Example of json format
json
{
"type": "and",
"data": [
{
"type": "operator",
"data": {
"attribute": "name",
"operator": "eq",
"value": "toto"
}
}
]
}
Example of usage
python
parser = JSONFiltersParser(raw_json_string)
You can finaly filter your query
query = session.query(Post)
filtered_query = parser.tree.filter(query)