Rich,
Can you post the GetValue method with the embedded SQL call? I
sometimes get the "has no 'execute' method error", when I've
accidentally left out a comma.
Mark
···
On Thu, 2007-12-27 at 09:20 -0800, Rich Shepard wrote:
Where is the GetValue() method called using the grid table mechanism?
In both the demo/GridCustTable.py and listing 14.2 in the wPIA book, the
GetValue(self, row, col) method is called to provide data to the grid widget
from the underlying table. The logic is in the grid table class rather than
in the grid class.In my application, the grid cells are populated by the string, 'Empty,' if
there are no project-specific data in the database table. The method in my
application is written thusly:def GetValue(self, row, col):
if self.appData.altData != None:
return self.data
else: # no data for existing or alternative condx, but project exists
return 'Empty'However, there exist data for the first three columns in the grid that I
would like to have loaded when the project data file is opened. However,
when I try to add an embedded SQL statement in the 'else:' clause, python
complains that the 'str' has no 'execute' method.Trying to figure out why the SQL does not work in this location as it does
in many others (including two other locations in the same class), I looked
to see where GetValue() was being called. I cannot find the call in the
table or grid classes. So, why is it invoked and placing the string, 'Empty,'
in the grid?Puzzled,
Rich