On 8/13/07, George Vilches <[EMAIL PROTECTED]> wrote: > > Russell Keith-Magee wrote: > > The configuration option will need to be a little more generic - i.e., > > putting the entire backend into a record mode - not just a single > > cursor call. > > Second, we could add a class level variable to each DatabaseWrapper, > since the handle to those seem to be instantiated only once at runtime > (at least, my short testing with just the Django built-in webserver > seemed to do so, I only assume that for Apache it's once per thread). > That would be an easy enough variable to update from pretty much > anywhere in the app: > > connection.playback_only = True
There's another possibility you haven't considered - dynamically replacing/wrapping the connection object. The test system already does this for the email framework - when the test framework is set up, the email framework is dynamically replaced with a mock; when the test framework is torn down, the mock is uninstalled. A similar approach could be used to 'start/end SQL recording'. Yours, Russ Magee %-) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-developers?hl=en -~----------~----~----~----~------~----~------~--~---