Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Django, initial data and custom SQL
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 Feb 12 2009, 1:48 am
From: Russell Keith-Magee <freakboy3...@gmail.com>
Date: Thu, 12 Feb 2009 15:48:09 +0900
Local: Thurs, Feb 12 2009 1:48 am
Subject: Re: Django, initial data and custom SQL
On Thu, Feb 12, 2009 at 2:54 PM, Ludvig Ericson

<ludvig.eric...@gmail.com> wrote:

> Feb 11, Johan Bergström:
>> I took the liberty of creating a ticket with attached patch at:
>> http://code.djangoproject.com/ticket/10236

> I fail to see how "it has consequences for existing code", as Russell
> put it.

It has consequences because you are proposing to change the order in
which indexes and custom SQL are applied. Any code that depends on the
existing order will be affected.

> I did discuss this with Bergström, and we came to the conclusion that
> it won't actually break much code, if any.

If it has the potential to break _any_ code, it is an unacceptable
change. The Django core developers have stated that we will maintain
backwards compatibility of the v1.0 interface, so any change with even
the _potential_ to affect backwards compatibility will need to be
checked very carefully.

However, the larger point is that you don't get to make that decision
about whether a change is acceptable or not. You can discuss a change
and make a recommendation, but ultimately the decision needs to be
made by a core developer. The Design Decision Required triage state
exists for exactly this reason.

> The only case which it could break, AFAICT, is if custom SQL manages
> to depend on the absence of indexes. I guess that could break code
> that violates indexing constraints, which are applied later, maybe? I
> don't know.

This is what needs to be confirmed, and given that it is a non-trivial
change, your decision needs to be confirmed by a core developer. I am
willing to be convinced, but you will need to prove to me that there
is no backwards compatibility problem here. The discussion in this
thread so far hasn't done that.

To answer the original question (why is it done in this order) -
mostly historical reasons. Originally, Django didn't have fixtures, so
initial data were all loaded from initial SQL. It's generally faster
to insert data and then add indicies, hence the order. When Django
added fixtures, the order wasn't changed.

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.