Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
Message from discussion Adding hooks to methods that generate SQL in django/core/management.py
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Russell Keith-Magee  
View profile  
 More options Aug 14 2007, 7:10 am
From: "Russell Keith-Magee" <freakboy3...@gmail.com>
Date: Tue, 14 Aug 2007 19:10:38 +0800
Local: Tues, Aug 14 2007 7:10 am
Subject: Re: Adding hooks to methods that generate SQL in django/core/management.py
On 8/13/07, George Vilches <g...@thataddress.com> 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 must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.