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
INSTALLATION
Try one of these:
pip install django-stored-queryset easy_install django-stored-queryset
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 django-stored-queryset-0.0.2.tar.gz.
File metadata
- Download URL: django-stored-queryset-0.0.2.tar.gz
- Upload date:
- Size: 8.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
da735d53fa1a6c036cd2427e11a522146cda73dcaf5a35f527c25f67ba9099cf
|
|
| MD5 |
8edcaa52990239682fa773d9f39ca429
|
|
| BLAKE2b-256 |
bf4d91b59d57b9bef9ead148f8ab8da457b902752ac926ddde5e430f3c27678f
|
File details
Details for the file django_stored_queryset-0.0.2-py2.7.egg.
File metadata
- Download URL: django_stored_queryset-0.0.2-py2.7.egg
- Upload date:
- Size: 11.5 kB
- Tags: Egg
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f978cc1dc7a5de2105a0aef0968737d55138332666f31e1b1ab6a3ffaaa7e515
|
|
| MD5 |
49ea96fe19c2f890755d0e51d14dcfe1
|
|
| BLAKE2b-256 |
d63ff27351beec7c383a9bdfa5726d156d1aca22a4fb2ac61c8425f582b18adf
|