Build sqlalchemy queries from jQuery-Query json
Project description
SQLAlchemy query builder for jQuery QueryBuilder
This package implements a sqlalchemy query builder for json data generated with (but not limited to) jQuery QueryBuilder.
Installation
#!python pip install sqlalchemy-querybuilder
Quickstart
Using sqlalchemy-querybuilder is very simple:
#!python from sqlalchemy_querybuilder import Filter from myapp import models, query rule = { "condition": "OR", "rules": [{ "field": "mytable.myfield", "operator": "equal", "value": "foo" }, ], } myfilter = Filter(models, query) print(myfilter)
The following attributes from the rules are ignored and therefore can be omitted:
id
type
input
WARNING
sqlalchemy-querybuilder does not do any kind of json validation.
Filter class
Filter accepts two arguments, models and query:
models - can either be a module defining classes which inherit from declarative_base or a dict of such classes with the name of the tables as keys.
query - a SQLAlchemy query object. Optionaly loaded with some entity.
Release History
0.1.1 (2017-11-19)
Bugfixes
Fixed issue when models parameter was a dict() of classes.
Added missing test for models parameter
0.1 (2017-07-10)
Improvements
First release
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for sqlalchemy-querybuilder-0.1.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3dff18ce67849318e937db0274557f9178b4839916db07e22558cdc40aaddb45 |
|
MD5 | cb405ce2c4329024dbea3bcef03ac952 |
|
BLAKE2b-256 | 7cdfde5be8709234b582264699985d0b8a4492002a1030fca11d76e02ec5e5e8 |
Hashes for sqlalchemy_querybuilder-0.1.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b292b65ca0bacd9c4ad59e6168d950141775ae3b71135da6dfda91ca6ca72320 |
|
MD5 | efa28e9b46f4733964ed649677bc8c35 |
|
BLAKE2b-256 | 11ba8e1b627f70ba807c41b1b7243e480a410315601001ca5f7528f59e460302 |