From: George Vilches <g...@thataddress.com>
Date: Mon, 13 Aug 2007 09:29:21 -0400
Local: Mon, Aug 13 2007 9:29 am
Subject: Re: Adding hooks to methods that generate SQL in django/core/management.py
Russell Keith-Magee wrote: Alright, that makes sense. So, my thought is, if we can't change the > On 8/12/07, George Vilches <g...@thataddress.com> wrote: >> How about the patch below? When you create the cursor, if you want >> access to "don't run this SQL, just have playback available", just use >> connection.cursor(playback_only=True), and if you want to roll the > This is a simple approach that would probably suffice for > The configuration option will need to be a little more generic - i.e., call to connection.cursor() on each instantiation, we're going to need some sort of static variable store that can get updated at runtime (or some global). I know that settings is right out for anything that changes at runtime, is there a Django-friendly way of storing a variable of this nature? If we can store this variable in some more non-code changing way, the rest of the patch should be fine, right? Here's my two thoughts for hopefully Django-friendly approaches: First, Brian Ferring's base class could have a static or class variable Second, we could add a class level variable to each DatabaseWrapper, connection.playback_only = True *should* be all we would need, anywhere in the app. If need be, we can Thoughts? 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.
| ||||||||||||||