Friday, March 23, 2012

serialize queryset metadata - what's the best approach?

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.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/J12imxAupPkJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate