Ed Leafe wrote:
> On Sep 5, 2008, at 10:16 AM, Paul McNett wrote:
> 
>> Yeah, the issue boils down to crossed connections between:
>>
>> biz.setSQL()
>> biz.getSQL()
>> biz.UserSQL
>> biz.AutoSQL
>>
>> biz.SQL, AFAICT, was never meant to be a property to set, but merely a
>> property for getSQL()/setSQL() to use. But now that SQL just sets
>> UserSQL, the AutoSQL gets short-circuited.
> 
>       Why is this considered 'short-circuited'? I would interpret setting  
> the bizobj's SQL property to mean that they want to explicitly set the  
> SQL, and not use the AutoSQL.

When code sets self.SQL, we now set UserSQL instead of the _SQL 
attribute. As you say, not a problem if this is user code setting it 
explicitly.

However, take a look at the old (non-underscored) getSQL() and setSQL() 
functions. getSQL() just asks the cursor for the SQL, and the cursor 
figures out whether to return UserSQL or AutoSQL.

setSQL()[1] makes the following assignment:

        self.SQL = self.getSQL()

So, after this point, self.UserSQL is now set explicitly, even if it was 
originally auto-generated.

Now, as far as I can see, the only code that uses getSQL() and setSQL() 
is datanav, so it would seem to follow that affected apps would be 
datanav-based (not sure, here).

So that's the problem, in a nutshell (calling setSQL() with no args used 
to set the sql to the AutoSQL, but now it sets UserSQL to the AutoSQL).

I don't have time to get the right solution whipped up, although the 
change will admittedly be trivial, and hopefully doesn't touch AppWizard 
generated code (but it may).

But perhaps the best solution would be to forget the DeprecationWarning 
and just remove the getter/setter for the SQL property completely. This 
will give us tracebacks so that the appdev can easily find/fix affected 
code.


>       Yeah, I've been really busy. I try to stay on top of questions, but  
> don't have the time to switch from Rackspace coding to Dabo coding  
> most days.

I shouldn't be taking the time I've been taking, but it is a convenient 
excuse to fuel my procrastination.

Paul


[1] Here's the dBizobj.setSQL() function:

     775   def setSQL(self, sql=None):
     776     """ Set the SQL query that will be executed upon requery().
     777
     778     This allows you to manually override the sql executed by 
the cursor. If no
     779     sql is passed, the SQL will get set to the value returned 
by getSQL().
     780     """
     781     if sql is None:
     782       # sql not passed; get it from the sql mixin:
     783       # Set the appropriate child filter on the link field
     784       self.setChildLinkFilter()
     785
     786       self.SQL = self.getSQL()
     787     else:
     788       # sql passed; set it explicitly
     789       self.SQL = sql


_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/[EMAIL PROTECTED]

Reply via email to