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 Changing the options in manage.py, adding more signals (was Re: 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
 
George Vilches  
View profile  
 More options Aug 14 2007, 10:07 am
From: George Vilches <g...@thataddress.com>
Date: Tue, 14 Aug 2007 10:07:33 -0400
Local: Tues, Aug 14 2007 10:07 am
Subject: Re: Changing the options in manage.py, adding more signals (was Re: Adding hooks to methods that generate SQL in django/core/management.py)

Russell Keith-Magee wrote:
> On 8/12/07, George Vilches <g...@thataddress.com> wrote:
>> 1) Add a signal to every option?

> If we were going to go down this path, this would be the preferred
> option. However, I'm not sure I'm convinced of the need. Which
> commands exactly do you think require signals?

Let's make the assumption that we can land the changes to manage.py that
would allow us to merge the SQL logger and the actual execution commands
into a single keyword, so that things like "sqlall" or "sqlreset" would
not be necessary, just their equivalent executions.  (We can easily map
this list backwards if we have to).  Then, the commands that would need
signals are (with a few footnotes):

   (merge sqlflush)
   flush [--verbosity] [--noinput]

   loaddata [--verbosity] fixture, fixture, ...

   (merge sqlreset)
   reset [--noinput][appname ...]

   (make this executable?)
   sql [appname ...]

   syncdb [--verbosity] [--noinput]
     Create the database tables for all apps in INSTALLED_APPS whose
     tables haven't already been created.

   (we would probably want to keep the following, but have a version
that's executable as well as printable)
   sqlall [appname ...]

   sqlclear [appname ...]

   sqlcustom [appname ...]

   sqlindexes [appname ...]

As far as the need goes, here's a generic example.  Say I need to create
a few extra tables for clever caching (something more dense than just
good indexing) as an extension to my Django app, and those tables are
very specific to the structure of the model (and as the model changes,
so will the contents of those tables).  Therefore, I need something that
would generate proper CREATE TABLE and DROP TABLE commands and indexes
and such, and it would be highly preferable that when I reset my app, I
can also reset my additional work that's directly correlated with my app.

I know there is a custom SQL option, but there's no good way to have the
DROP and the CREATE (or the create indexes, etc.) isolated from one
another, since the custom SQL option doesn't support reading in one of a
set of files.  And anyway, custom SQL static files wouldn't be very good
for this, because we want the contents of the table to be accurate to
the Model at this moment in time, and having to generate that statically
when we have an awesome Django framework to tie into to do this with
doesn't seem very DRY. :)

Thanks,
George


 
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.