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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sqlalchemy-querybuilder-0.1.2.tar.gz.
File metadata
- Download URL: sqlalchemy-querybuilder-0.1.2.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3dff18ce67849318e937db0274557f9178b4839916db07e22558cdc40aaddb45
|
|
| MD5 |
cb405ce2c4329024dbea3bcef03ac952
|
|
| BLAKE2b-256 |
7cdfde5be8709234b582264699985d0b8a4492002a1030fca11d76e02ec5e5e8
|
File details
Details for the file sqlalchemy_querybuilder-0.1.2-py2.py3-none-any.whl.
File metadata
- Download URL: sqlalchemy_querybuilder-0.1.2-py2.py3-none-any.whl
- Upload date:
- Size: 5.7 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b292b65ca0bacd9c4ad59e6168d950141775ae3b71135da6dfda91ca6ca72320
|
|
| MD5 |
efa28e9b46f4733964ed649677bc8c35
|
|
| BLAKE2b-256 |
11ba8e1b627f70ba807c41b1b7243e480a410315601001ca5f7528f59e460302
|