commit-gnue
[Top][All Lists]
Advanced

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

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


From: reinhard
Subject: [gnue] r7410 - in trunk/gnue-common/src/datasources: . drivers/Base
Date: Mon, 18 Apr 2005 17:50:09 -0500 (CDT)

Author: reinhard
Date: 2005-04-18 17:50:08 -0500 (Mon, 18 Apr 2005)
New Revision: 7410

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


Modified: trunk/gnue-common/src/datasources/GDataSource.py
===================================================================
--- trunk/gnue-common/src/datasources/GDataSource.py    2005-04-18 22:38:52 UTC 
(rev 7409)
+++ trunk/gnue-common/src/datasources/GDataSource.py    2005-04-18 22:50:08 UTC 
(rev 7410)
@@ -331,10 +331,6 @@
     self.name = string.lower(self.name)
     self._topObject._datasourceDictionary[self.name]=self
 
-    dataObject._fieldReferences = self._fieldReferences
-    dataObject._unboundFieldReferences = self._unboundFieldReferences
-    dataObject._defaultData = self._defaultData
-
     hasRaw = False
     for child in self._children:
       if isinstance(child, GConditions.GCondition):
@@ -857,6 +853,7 @@
             'table':       {
                'Label': _('Table Name'),
                'Typecast': GTypecast.name,
+               'Default':  '',
                'Description': 'The table in the database this datasource '
                               'will point to.' },
             'cache':       {

Modified: trunk/gnue-common/src/datasources/drivers/Base/DataObject.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/Base/DataObject.py        
2005-04-18 22:38:52 UTC (rev 7409)
+++ trunk/gnue-common/src/datasources/drivers/Base/DataObject.py        
2005-04-18 22:50:08 UTC (rev 7410)
@@ -43,9 +43,6 @@
     self._connection = connection
     self.__dataSource = dataSource
 
-    self.table = None
-    self.distinct = False
-
     self.masterlink = ""
     self.detaillink = ""
 
@@ -55,19 +52,8 @@
 
     self._masterObject = None
     self._detailObjects = []
-    self._fieldReferences = {}  # Set by GDataSource; lists all fields
-                                # a client explicitly references
 
-    self._unboundFieldReferences = {}  # Contains names of all unbound
-                                       # field references
 
-    self._defaultData = {}
-
-
-  # Do we have a master datasource?
-  def hasMaster(self):
-    return self._masterObject != None
-
   def createResultSet (self, conditions ={}, readOnly=0, masterRecordSet=None):
 
     cond = GConditions.combineConditions (conditions, self._staticCondition)
@@ -84,11 +70,11 @@
 
     if self.__dataSource.type == 'object':
       resultset.query ('object',
-                       table      = self.table,
+                       table      = self.__dataSource.table,
                        fieldnames = self.__dataSource._fieldReferences.keys (),
                        condition  = cond,
-                       sortorder  = self.sorting and self.sorting or [],
-                       distinct   = self.distinct)
+                       sortorder  = self.__dataSource.sorting and 
self.__dataSource.sorting or [],
+                       distinct   = self.__dataSource.distinct)
 
     elif self.__dataSource.type == 'static':
       resultset.query ('static', data = self._staticSet.data)
@@ -146,10 +132,10 @@
 
     # Make sure "master" fields will be in our future query
     for field in dataObject._masterfields:
-      self._fieldReferences[string.strip(field)] = ""
+      self.__dataSource._fieldReferences[string.strip(field)] = ""
 
     for field in dataObject._detailfields:
-      dataObject._fieldReferences[string.strip(field)] = ""
+      dataObject.__dataSource._fieldReferences[string.strip(field)] = ""
 
     self._detailObjects.append ([dataObject, handler])
 





reply via email to

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