commit-gnue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnue] r7426 - in trunk/gnue-common/src/datasources: . drivers/Base


From: reinhard
Subject: [gnue] r7426 - in trunk/gnue-common/src/datasources: . drivers/Base
Date: Tue, 19 Apr 2005 17:26:00 -0500 (CDT)

Author: reinhard
Date: 2005-04-19 17:25:59 -0500 (Tue, 19 Apr 2005)
New Revision: 7426

Modified:
   trunk/gnue-common/src/datasources/GDataSource.py
   trunk/gnue-common/src/datasources/drivers/Base/DataObject.py
Log:
Moved more stuff from DataObject to GDataSource.


Modified: trunk/gnue-common/src/datasources/GDataSource.py
===================================================================
--- trunk/gnue-common/src/datasources/GDataSource.py    2005-04-19 21:15:13 UTC 
(rev 7425)
+++ trunk/gnue-common/src/datasources/GDataSource.py    2005-04-19 22:25:59 UTC 
(rev 7426)
@@ -54,8 +54,9 @@
     GObjects.GObj.__init__ (self, parent, type)
 
     self.type = "object"
-    self.connection = None
+    self.connection = None              # Connection name
     self._connections = None
+    self._connection = None             # GConnection object
     self._dataObject = None
     self._connectionComment = ""
     self._hasFieldReferences = False    # True if any fields are referenced,
@@ -159,8 +160,6 @@
 
   def __trigger_set_order_by (self, value):
     self.sorting = self.__convertOrderBy (value)
-    if self._dataObject:
-      self._dataObject.sorting = self.sorting
 
 
   # ---------------------------------------------------------------------------
@@ -295,7 +294,7 @@
 
         for child in self._children:
           if isinstance(child, GStaticSet):
-            dataObject._staticSet = child
+            self._staticSet = child
             break
 
 
@@ -312,14 +311,14 @@
       self._connection = dataObject._connection
       
       # Check if the connection has a fixed primary key name
-      primarykeyFields = dataObject._connection._primarykeyFields
+      primarykeyFields = self._connection._primarykeyFields
       if primarykeyFields:
         self._primarykeyFields = primarykeyFields
         for field in self._primarykeyFields:
           self._fieldReferences [field] = True
 
       # Include the rowid in list of field references
-      rowidField = dataObject._connection._rowidField
+      rowidField = self._connection._rowidField
       if rowidField:
         # TODO: checks if the rowid is available and should be used go here:
         # 1. if primary key should be prefered, don't set self._rowidField
@@ -334,10 +333,10 @@
     hasRaw = False
     for child in self._children:
       if isinstance(child, GConditions.GCondition):
-        dataObject._staticCondition = child
+        self._staticCondition = child
         break
       elif isinstance(child, GSql):
-        dataObject._rawSQL = child
+        self._rawSQL = child
         hasRaw = True
 
 
@@ -362,7 +361,6 @@
         except KeyError:
           pass
     self._dataObject = dataObject
-    self._dataObject.sorting = self.sorting
 
 
   # ---------------------------------------------------------------------------
@@ -379,7 +377,7 @@
   # ---------------------------------------------------------------------------
 
   def setCondition (self, mycondition):
-    self._dataObject._staticCondition = mycondition
+    self._staticCondition = mycondition
 
 
   # ---------------------------------------------------------------------------
@@ -387,7 +385,7 @@
   # ---------------------------------------------------------------------------
 
   def getCondition (self):
-    return self._dataObject._staticCondition
+    return self._staticCondition
 
 
   # ---------------------------------------------------------------------------
@@ -1050,10 +1048,10 @@
     self._toplevelParent = self._type
 
   def getIntrospector (self):
-    return self._dataObject._connection.introspector
+    return self._connection.introspector
 
   def getSchemaCreator (self):
-    return self._dataObject._connection.getSchemaCreator ()
+    return self._connection.getSchemaCreator ()
 
 
 # =============================================================================

Modified: trunk/gnue-common/src/datasources/drivers/Base/DataObject.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/Base/DataObject.py        
2005-04-19 21:15:13 UTC (rev 7425)
+++ trunk/gnue-common/src/datasources/drivers/Base/DataObject.py        
2005-04-19 22:25:59 UTC (rev 7426)
@@ -56,7 +56,7 @@
 
   def createResultSet (self, conditions ={}, readOnly=0, masterRecordSet=None):
 
-    cond = GConditions.combineConditions (conditions, self._staticCondition)
+    cond = GConditions.combineConditions (conditions, 
self.__dataSource._staticCondition)
 
     # Add condition from master record
     mastercond = {}
@@ -77,10 +77,10 @@
                        distinct   = self.__dataSource.distinct)
 
     elif self.__dataSource.type == 'static':
-      resultset.query ('static', data = self._staticSet.data)
+      resultset.query ('static', data = self.__dataSource._staticSet.data)
 
     elif self.__dataSource.type == 'sql':
-      resultset.query ('sql', sql = self._rawSQL.getChildrenAsContent ())
+      resultset.query ('sql', sql = 
self.__dataSource._rawSQL.getChildrenAsContent ())
 
     return resultset
 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]