pickleable Django QuerySet
Project description
OUTLINE
Persistent representation of django QuerySet`s.
Quick creation of simple search functionality without custom SQL or implicit markers/ids/indexes storing.
EXAMPLES
Trivial example
from stored.queryset import FilterQuerySet q = FilterQuerySet('Q(text__icontains="sometext")', 'someapp.somemodel') q.objects.all() #outputs all loads(dumps(q)).objects.all() #same result
Simple with literals
#define default literals q0 = FilterQuerySet('Q(text__icontains="{literal_text}")', 'someapp.somemodel', literal_parameter='"sometext"') #new queryset with different `literal_text` value q1 = q0.literal(literal_text='"some_other_text"').objects.all() #literals are parsed with safe `ast.literal_eval` and can be taken from user input #q1 can be pickled and thus user search can be stored in db #if to keep different `FilterQuerySet` for each user. loads(dumps(q1)).objects.all() #same result
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
Close
Hashes for django-stored-queryset-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc45715e8ea4b4ad938a30c5a3f6dd8111eb5e405da1fc193b235ae7fabb209f |
|
MD5 | c59cc5546179af12c44ec3d5a1f98f8a |
|
BLAKE2b-256 | 62cc0ede3030ec873bafa488987583b88eab08f22dfed5caff70b9bc0b6fd490 |
Close
Hashes for django_stored_queryset-0.0.1-py2.7.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 73209871fc2533677a3f5830f819198caee9634c2c698d3272ead2c5e33a33be |
|
MD5 | 65d942f9868d7864788f114835e39f50 |
|
BLAKE2b-256 | 5f6e91cd1fdc67b19f68326b7e3b479894f03dc6cfff5cb9e41900e8d0ba9911 |