dabo Commit
Revision 1519
Date: 2005-11-04 23:06:23 -0800 (Fri, 04 Nov 2005)
Author: paul

Changed:
U   trunk/dabo/lib/datanav/Grid.py
U   trunk/dabo/lib/datanav/Page.py
U   trunk/dabo/ui/uiwx/dGrid.py

Log:
Minor performance enhancement to dGrid by avoiding multiple calls to
fillGrid().


Diff:
Modified: trunk/dabo/lib/datanav/Grid.py
===================================================================
--- trunk/dabo/lib/datanav/Grid.py      2005-11-05 06:30:12 UTC (rev 1518)
+++ trunk/dabo/lib/datanav/Grid.py      2005-11-05 07:06:23 UTC (rev 1519)
@@ -32,20 +32,6 @@
                        self.DataSource = self.Form.previewDataSource
 
        
-       def getDataSet_old_pkm(self, requery=False):
-               # Normally, getDataSet() just returns the object reference to 
the list
-               # previously generated, but if we just requeried, we need to 
ask the 
-               # bizobj for the new dataSet.
-               if requery:
-                       ret = self.dataSet = None
-               ret = self.dataSet
-               if not ret:
-                       if not self.inAutoSizeCalc:
-                               if self.bizobj:
-                                       ret = self.dataSet = 
self.bizobj.getDataSet()
-               return ret
-       
-
        def populate(self):
                ##pkm ds = self.getDataSet(requery=True)
                ds = self.DataSource
@@ -77,8 +63,8 @@
                bizobj.sort(self.sortedColumn, self.sortOrder, 
self.caseSensitiveSorting)
                
        
-       def setBizobj(self, biz):
-               self.DataSource = biz.DataSource
+#      def setBizobj(self, biz):
+#              self.DataSource = biz.DataSource
 
 
        def onGridLeftDClick(self, evt): 
@@ -149,7 +135,6 @@
                """ Request that the current row be deleted."""
                self.Parent.deleteRecord(self.DataSource)
                self.fillGrid()
-#              self.setFocus()  ## required or assertion happens on Gtk
 
 
        def pickRecord(self, evt=None):

Modified: trunk/dabo/lib/datanav/Page.py
===================================================================
--- trunk/dabo/lib/datanav/Page.py      2005-11-05 06:30:12 UTC (rev 1518)
+++ trunk/dabo/lib/datanav/Page.py      2005-11-05 07:06:23 UTC (rev 1519)
@@ -531,7 +531,8 @@
                grid = self.Form.BrowseGridClass(self, NameBase="BrowseGrid")
                grid.FieldSpecs = self.Form.FieldSpecs
                if not self.Form.preview:
-                       grid.setBizobj(bizobj)
+                       pass
+                       #grid.setBizobj(bizobj)
                        grid.DataSource = bizobj.DataSource
                else:
                        grid.DataSource = self.Form.previewDataSource

Modified: trunk/dabo/ui/uiwx/dGrid.py
===================================================================
--- trunk/dabo/ui/uiwx/dGrid.py 2005-11-05 06:30:12 UTC (rev 1518)
+++ trunk/dabo/ui/uiwx/dGrid.py 2005-11-05 07:06:23 UTC (rev 1519)
@@ -212,7 +212,6 @@
                
        def fillTable(self, force=False):
                """ Fill the grid's data table to match the data set."""
-
                _oldRowCount = self._oldRowCount
 
                # Get the data from the grid.
@@ -1623,12 +1622,14 @@
                if not ds:
                        return False
                if isinstance(ds, basestring):
-                       # assume it is a bizobj datasource:
-                       self.DataSource = ds
+                       # Assume it is a bizobj datasource.
+                       if self.DataSource != ds:
+                               self.DataSource = ds
                else:
                        self.DataSource = None
                        self.DataSet = ds
                bizobj = self.getBizobj()
+
                if bizobj:
                        data = bizobj.getDataSet(rows=1)
                        if data:
@@ -1638,10 +1639,9 @@
                else:
                        # not a bizobj datasource
                        firstRec = ds[0]
-               # Dabo cursors add some columns to the data set. These
-               # artifacts need to be removed. They all begin with 'dabo-'.
+
                colKeys = [key for key in firstRec.keys()
-                               if (key[:5] != "dabo-") and (key not in 
columnsToSkip)]
+                               if (key not in columnsToSkip)]
 
                # Add the columns
                for colKey in colKeys:




_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev

Reply via email to