serialize queryset metadata - what's the best approach?

22 views
Skip to first unread message

mikeS

unread,
Mar 23, 2012, 5:21:12 PM3/23/12
to django...@googlegroups.com
I'm looking at letting my users implement reports via a web interface where they can essentially define the report. I need to store that report definition in the db, so they can re-run it whenever.

The problem I have is serialize all that to and from a QuerySet.
I've hacked something that builds the query from the web definition using Qs.
I pass that into a query set, call _as_sql on it, save/serialize the sql and the params in the db.
Then next time, read that and pass it into raw.

It's pretty hacky and I'd like to avoid using _as_sql if possible.
Is there a better way to implement what I want?

Cheers,
Mike S.
Reply all
Reply to author
Forward
0 new messages