dabapps/django-zen-queries

Be told what query it was that was naughtily issued during serialization

pmg103 opened this issue · 0 comments

Currently, it’s not possible to have the query included in the stack trace, as zen queries does its magic when the ORM grabs a cursor rather than when it actually runs the query itself

We could instead return a mock, which raises the exception when asked to execute a query, logging said query

You’d have to figure out all the ways that a cursor can be used and monkeypatch all of them, or catch everything in getattr or whatever it is -- some kind of magic mock that just raises whenever a method is called..

Python's magic mock might do that for you