[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnue] r7219 - in trunk/gnue-common/src/datasources/drivers: Base csv/cs
From: |
reinhard |
Subject: |
[gnue] r7219 - in trunk/gnue-common/src/datasources/drivers: Base csv/csv dbf/dbf special/static special/unbound |
Date: |
Thu, 17 Mar 2005 16:18:26 -0600 (CST) |
Author: reinhard
Date: 2005-03-17 16:18:25 -0600 (Thu, 17 Mar 2005)
New Revision: 7219
Removed:
trunk/gnue-common/src/datasources/drivers/special/static/RecordSet.py
Modified:
trunk/gnue-common/src/datasources/drivers/Base/RecordSet.py
trunk/gnue-common/src/datasources/drivers/csv/csv/DataObject.py
trunk/gnue-common/src/datasources/drivers/dbf/dbf/DataObject.py
trunk/gnue-common/src/datasources/drivers/special/static/ResultSet.py
trunk/gnue-common/src/datasources/drivers/special/unbound/Driver.py
Log:
Call _postChanges in base driver only when a connection is available; this
makes the own RecordSet class for static and unbound datasources obsolete.
Modified: trunk/gnue-common/src/datasources/drivers/Base/RecordSet.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/Base/RecordSet.py 2005-03-17
21:43:02 UTC (rev 7218)
+++ trunk/gnue-common/src/datasources/drivers/Base/RecordSet.py 2005-03-17
22:18:25 UTC (rev 7219)
@@ -389,8 +389,10 @@
deleting = self.isDeleted ()
- gDebug (8, 'Posting datasource %s' % self._parent._dataObject.name)
- self._postChanges (recordNumber)
+ # If we have a connection (i.e. we aren't static or unbound), do the post
+ if self._parent._dataObject._connection:
+ gDebug (8, 'Posting datasource %s' % self._parent._dataObject.name)
+ self._postChanges (recordNumber)
# Post all detail records
for child in (self._cachedDetailResultSets.values ()):
Modified: trunk/gnue-common/src/datasources/drivers/csv/csv/DataObject.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/csv/csv/DataObject.py
2005-03-17 21:43:02 UTC (rev 7218)
+++ trunk/gnue-common/src/datasources/drivers/csv/csv/DataObject.py
2005-03-17 22:18:25 UTC (rev 7219)
@@ -35,7 +35,6 @@
from gnue.common.datasources.GDataObjects import *
from gnue.common.datasources.drivers.special.static.DataObject import
STATIC_DataObject
from gnue.common.datasources.drivers.special.static.ResultSet import
STATIC_ResultSet
-from gnue.common.datasources.drivers.special.static.RecordSet import
STATIC_RecordSet
###########################################################
#
@@ -54,12 +53,6 @@
class CSV_ResultSet(STATIC_ResultSet):
- def __init__(self, dataObject, cursor=None, defaultValues={},
masterRecordSet=None):
- ResultSet.__init__(self, dataObject, \
- cursor, defaultValues, masterRecordSet)
-
- self._recordSetClass = STATIC_RecordSet
-
# Returns 1=DataObject has uncommitted changes
def isPending(self):
return 0 # Static DataObjects cannot have pending changes :)
Modified: trunk/gnue-common/src/datasources/drivers/dbf/dbf/DataObject.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/dbf/dbf/DataObject.py
2005-03-17 21:43:02 UTC (rev 7218)
+++ trunk/gnue-common/src/datasources/drivers/dbf/dbf/DataObject.py
2005-03-17 22:18:25 UTC (rev 7219)
@@ -69,12 +69,6 @@
###########################################################
class DBF_ResultSet(ResultSet.STATIC_ResultSet):
- def __init__(self, dataObject, cursor=None, defaultValues={},
masterRecordSet=None):
- ResultSet.STATIC_ResultSet.__init__(self, dataObject, \
- cursor, defaultValues, masterRecordSet)
-
- self._recordSetClass = RecordSet.STATIC_RecordSet
-
# Returns 1=DataObject has uncommitted changes
def isPending(self):
return 0 # Static DataObjects cannot have pending changes :)
Deleted: trunk/gnue-common/src/datasources/drivers/special/static/RecordSet.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/special/static/RecordSet.py
2005-03-17 21:43:02 UTC (rev 7218)
+++ trunk/gnue-common/src/datasources/drivers/special/static/RecordSet.py
2005-03-17 22:18:25 UTC (rev 7219)
@@ -1,44 +0,0 @@
-#
-# This file is part of GNU Enterprise.
-#
-# GNU Enterprise is free software; you can redistribute it
-# and/or modify it under the terms of the GNU General Public
-# License as published by the Free Software Foundation; either
-# version 2, or (at your option) any later version.
-#
-# GNU Enterprise is distributed in the hope that it will be
-# useful, but WITHOUT ANY WARRANTY; without even the implied
-# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-# PURPOSE. See the GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public
-# License along with program; see the file COPYING. If not,
-# write to the Free Software Foundation, Inc., 59 Temple Place
-# - Suite 330, Boston, MA 02111-1307, USA.
-#
-# Copyright 2001-2005 Free Software Foundation
-#
-# FILE:
-# _static/DBdriver.py
-#
-# DESCRIPTION:
-# Virtual database driver for a connectionless, static set of data
-#
-# NOTES:
-# Used whenever a fixed set of data is needed
-#
-
-__all__ = ['STATIC_RecordSet']
-
-import string
-from gnue.common.datasources.drivers import Base
-
-
-class STATIC_RecordSet (Base.RecordSet):
-
- def isPending(self):
- return 0
-
- # Post any changes to database
- def _postChanges(self, recordNumber=None):
- return 1
Modified: trunk/gnue-common/src/datasources/drivers/special/static/ResultSet.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/special/static/ResultSet.py
2005-03-17 21:43:02 UTC (rev 7218)
+++ trunk/gnue-common/src/datasources/drivers/special/static/ResultSet.py
2005-03-17 22:18:25 UTC (rev 7219)
@@ -31,16 +31,9 @@
__all__ = ["STATIC_ResultSet"]
from gnue.common.datasources.drivers import Base
-from RecordSet import STATIC_RecordSet
class STATIC_ResultSet(Base.ResultSet):
- def __init__(self, dataObject, cursor=None, defaultValues={},
masterRecordSet=None):
- Base.ResultSet.__init__(self, dataObject, \
- cursor, defaultValues, masterRecordSet)
-
- self._recordSetClass = STATIC_RecordSet
-
# Returns 1=DataObject has uncommitted changes
def isPending(self):
return 0 # Static DataObjects cannot have pending changes :)
Modified: trunk/gnue-common/src/datasources/drivers/special/unbound/Driver.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/special/unbound/Driver.py
2005-03-17 21:43:02 UTC (rev 7218)
+++ trunk/gnue-common/src/datasources/drivers/special/unbound/Driver.py
2005-03-17 22:18:25 UTC (rev 7219)
@@ -52,12 +52,6 @@
###########################################################
class NIL_ResultSet(ResultSet):
- def __init__(self, dataObject, cursor=None, defaultValues={},
masterRecordSet=None):
- ResultSet.__init__(self, dataObject, \
- cursor, defaultValues, masterRecordSet)
- self._recordSetClass = NIL_RecordSet
-
-
# Returns 1=DataObject has uncommitted changes
def isPending(self):
return 0 # Empty DataObjects cannot have pending changes :)
@@ -83,23 +77,7 @@
return self._recordSetClass(self)
-###########################################################
-#
#
-#
-###########################################################
-class NIL_RecordSet (RecordSet):
-
- def isPending(self):
- return 0
-
- # Post any changes to database
- def _postChanges(self, recordNumber=None):
- return 1
-
-
-
-#
# Extensions to Trigger Namespaces
#
class TriggerExtensions:
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnue] r7219 - in trunk/gnue-common/src/datasources/drivers: Base csv/csv dbf/dbf special/static special/unbound,
reinhard <=