This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

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
Release History

Release History

This version
History Node

0.0.2

History Node

0.0.1

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
django_stored_queryset-0.0.2-py2.7.egg (11.5 kB) Copy SHA256 Checksum SHA256 2.7 Egg May 4, 2012
django-stored-queryset-0.0.2.tar.gz (8.6 kB) Copy SHA256 Checksum SHA256 Source May 4, 2012

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting