From: "Russell Keith-Magee" <freakboy3...@gmail.com>
Date: Thu, 9 Aug 2007 20:45:49 +0800
Local: Thurs, Aug 9 2007 8:45 am
Subject: Re: Adding hooks to methods that generate SQL in django/core/management.py
On 8/9/07, George Vilches <g...@thataddress.com> wrote:
> But, these cases still wouldn't allow you to just print this +1. I love this idea! As a side note, it actually fits in with a whole > additionally generated SQL, or in any way retrieve and use it from any > of the other commands (sql, sqlclear, etc.). This is sometimes > frustrating, as these additional SQL statements being generated are > dependent on the current state of the model. lot of other ideas that have been circulating recently. - Speeding up the test system with a database mock will require the - The schema-evolution suggestions that are under development may > So, my proposal is this: generate hooks for users. For each of the This is actually how the management commands started out - once upon a > get_custom_sql/get_create_sql/etc., add a small portion that checks the > installed apps for their own management.py file and an appropriate > method. For instance, "sqlcustom"'s method could be > "get_custom_sql_for_model_all", denoting that it's run on every model in > every app that is having the current manage.py operation applied to it. > These functions would be expected to return an array of SQL > statements, which could then be fit in with the other generated SQL from > each of the current built in methods. time, you ran ./manage.py install myapp, which was a wrapper around calling ./manage.py sqlall myapp and piping the output to the database. The problem is that this approach isn't very flexible. Some of what I would suggest approaching this problem at lower than that - You then add a --sql flag to ./manage.py that sets up the recording Part of this infrastructure is already in place for logging purposes. Yours, 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.
| ||||||||||||||