From: George Vilches <g...@thataddress.com>
Date: Sun, 12 Aug 2007 09:49:17 -0400
Local: Sun, Aug 12 2007 9:49 am
Subject: Changing the options in manage.py, adding more signals (was Re: Adding hooks to methods that generate SQL in django/core/management.py)
I'm splitting this conversation off from the other conversation on SQL
logging, because I think that topic has merits all its own, and this one has more to discuss and slightly more possibility for backwards-incompatibility. I don't want to pork barrel this issue in with a perfectly legitimate one. :) Russell Keith-Magee wrote: What I was proposing didn't involve taking the SQL code that Django > On 8/9/07, George Vilches <g...@thataddress.com> wrote: >> So, my proposal is this: generate hooks for users. For each of the >> 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. > This is actually how the management commands started out - once upon a > The problem is that this approach isn't very flexible. Some of what generates and modifying it. Rather, this would allow the user to add more SQL that they generate entirely independently from what Django's internals are generating, but based on contents in the app (as opposed to static SQL files that can be loaded in). Example: Say I'm building a dynamic model. Say that, for whatever So possibly, we get rid of "sql", "sqldelete" and the like, and only Here's the two options I see: 1) Add a signal to every option? Right now, only syncdb has a signal, 2) Add a callback to every option? This is similar to the example I My vote is for 1), I think with the playback feature, it would be pretty Thanks, 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.
| ||||||||||||||