Building Q queries

0 views
Skip to first unread message

mettwoch

unread,
Nov 4, 2009, 11:00:02 AM11/4/09
to Django users
Hi,

I wonder if I can use the Q object to build queries interactively and
store them for repeated use. I imagine building up the tree of the Q
object in a simple web interface that introspects the models, shows
the fields and some operators and let the user build, name and store
queries for later use. Could you point me to a source of information
that could help me developing this.

Marc

John Boxall

unread,
Nov 4, 2009, 2:09:36 PM11/4/09
to Django users
Hey Marc,

You can store queryset by pickling them - you might find this
documentation helpful:
http://docs.djangoproject.com/en/dev/ref/models/querysets/#id2

I could imagine an interface that combined Alex's django-filter with a
Model for storing the pickled query objects to implement your idea:
http://github.com/alex/django-filter

Cheers,

John
Reply all
Reply to author
Forward
0 new messages