[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gnue gnue-common/src/GDataObjects.py gnue-commo...
From: |
James Thompson |
Subject: |
gnue gnue-common/src/GDataObjects.py gnue-commo... |
Date: |
Thu, 30 Aug 2001 14:34:48 -0700 |
CVSROOT: /home/cvs
Module name: gnue
Changes by: James Thompson <address@hidden> 01/08/30 14:34:48
Modified files:
gnue-common/src: GDataObjects.py GObjects.py
gnue-common/src/dbdrivers/_dbsig: DBdriver.py
gnuef/src/GFObjects: GFBlock.py GFEntry.py GFObj.py
Log message:
Fixes misc TODOs in the code
Deletions fixed
Commits now jump to first record left after commit
Removed unneeded initialize from base object
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-common/src/GDataObjects.py.diff?cvsroot=OldCVS&tr1=1.9&tr2=1.10&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-common/src/GObjects.py.diff?cvsroot=OldCVS&tr1=1.17&tr2=1.18&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-common/src/dbdrivers/_dbsig/DBdriver.py.diff?cvsroot=OldCVS&tr1=1.11&tr2=1.12&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnuef/src/GFObjects/GFBlock.py.diff?cvsroot=OldCVS&tr1=1.10&tr2=1.11&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnuef/src/GFObjects/GFEntry.py.diff?cvsroot=OldCVS&tr1=1.10&tr2=1.11&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnuef/src/GFObjects/GFObj.py.diff?cvsroot=OldCVS&tr1=1.6&tr2=1.7&r1=text&r2=text
Patches:
Index: gnue/gnue-common/src/GDataObjects.py
diff -u gnue/gnue-common/src/GDataObjects.py:1.9
gnue/gnue-common/src/GDataObjects.py:1.10
--- gnue/gnue-common/src/GDataObjects.py:1.9 Wed Aug 29 17:23:12 2001
+++ gnue/gnue-common/src/GDataObjects.py Thu Aug 30 14:34:48 2001
@@ -86,11 +86,7 @@
self._masterfields = []
self._detailfields = []
- self._masterObject = None
-
- # TODO: This is SO not true.
- # _detailObjects really isn't used anywhere and shoud be removed
-
+ self._masterObject = None
self._detailObjects = []
self._dataConnection = None
self._resultSetClass = ResultSet
@@ -372,13 +368,8 @@
for record in (self._cachedRecords):
record.post()
- # jst
def notifyDetailObjects(self):
GDebug.printMesg(5,'Master record changed; Notifying Detail Objects')
- #if self.current:
- # for detail in self.current._detailObjects:
- # print "GDataObjects ",detail
-
for detail in self._dataObject._detailObjects:
rs = detail[0]._masterRecordChanged(self)
if detail[1]:
@@ -552,6 +543,14 @@
# Post any changes to database
def _postChanges(self):
return 1
+
+
+
+
+
+
+
+
Index: gnue/gnue-common/src/GObjects.py
diff -u gnue/gnue-common/src/GObjects.py:1.17
gnue/gnue-common/src/GObjects.py:1.18
--- gnue/gnue-common/src/GObjects.py:1.17 Sun Aug 12 12:55:26 2001
+++ gnue/gnue-common/src/GObjects.py Thu Aug 30 14:34:48 2001
@@ -67,12 +67,12 @@
# This will be the base of the new initialization system for gnue
# each childs initialization function must call GObj.initialize()
#
- def initialize(self):
- GDebug.printMesg(6,"Initializing %s" % self.getObjectType())
- if self._children:
- for child in self._children:
- if isinstance(child, GObj):
- child.initialize()
+ #def initialize(self):
+ # GDebug.printMesg(6,"Initializing %s" % self.getObjectType())
+ # if self._children:
+ # for child in self._children:
+ # if isinstance(child, GObj):
+ # child.initialize()
#
# phaseInit
Index: gnue/gnue-common/src/dbdrivers/_dbsig/DBdriver.py
diff -u gnue/gnue-common/src/dbdrivers/_dbsig/DBdriver.py:1.11
gnue/gnue-common/src/dbdrivers/_dbsig/DBdriver.py:1.12
--- gnue/gnue-common/src/dbdrivers/_dbsig/DBdriver.py:1.11 Thu Aug 30
09:57:55 2001
+++ gnue/gnue-common/src/dbdrivers/_dbsig/DBdriver.py Thu Aug 30 14:34:48 2001
@@ -86,6 +86,7 @@
statement = "DELETE FROM %s WHERE %s" % \
(self._parent._dataObject.table, string.join(where,' AND ') )
+ return statement
def _buildInsertStatement(self):
vals = []
Index: gnue/gnuef/src/GFObjects/GFBlock.py
diff -u gnue/gnuef/src/GFObjects/GFBlock.py:1.10
gnue/gnuef/src/GFObjects/GFBlock.py:1.11
--- gnue/gnuef/src/GFObjects/GFBlock.py:1.10 Wed Aug 29 17:23:12 2001
+++ gnue/gnuef/src/GFObjects/GFBlock.py Thu Aug 30 14:34:48 2001
@@ -54,14 +54,8 @@
GFEventAware.__init__(self)
self._type = "GFBlock"
- # TODO: For some reason, self.initialize is already getting called.
- # TODO: If we rename to something else and list here, something else
- # TODO: breaks. If we list it here as self.initialize, then entryList
- # TODO: is doubly populated, causing lots o' problems.
- self._inits = []
- #self._inits = [self.initialize]
+ self._inits = [self.initialize]
-
self._datasource = None
self._resultSet = None
@@ -125,20 +119,18 @@
else:
# TODO: This means no results were returned from a query.
# TODO: It probably shouldn't create a new record :) Display a message?
- print "WARNING: GFBlock.py self.newRecord - ", self.newRecord()
+ self.newRecord()
#
# Moves the proper record into editing position
#
def switchRecord(self, adjustment):
self._currentRecord = self._resultSet.getRecordNumber()
- print "Current record is %s" % self._currentRecord
for entry in self._entryList:
entry.switchRecord()
entry.recalculateVisible( adjustment, self._currentRecord,
self._recordCount)
self._form.updateUIEntry(entry)
- # TODO: qwik hack ask jamest how to handle long term for adj 0
if adjustment <> 0:
self.processTrigger('on-switch')
@@ -157,15 +149,9 @@
if self._resultSet.nextRecord():
self._recordCount = self._resultSet.getCacheCount()
self.switchRecord(1)
- #TODO: pending system is broken?
elif int(GConfig.get('autocreate')) and not
self._resultSet.current.isEmpty():
self.newRecord()
-# TODO: This statement only allowed new entries
-# if int(GConfig.get('autocreate')) and
(self._dataSourceLink.resultSetStatus[self._recordCount] != 'saved' or
-# (hasattr(self._dataSourceLink,'uniqueKey') and
self._dataSourceLink.resultSet[self._recordCount].has_key(self._dataSourceLink.uniqueKey))
):
-
-
def prevRecord(self):
if self._resultSet.prevRecord():
self.switchRecord(-1)
@@ -187,19 +173,9 @@
if not self._dataSourceLink.hasMaster():
self._resultSet.post()
self._dataSourceLink._dataObject.commit()
-
- # TODO: What should happen after a commit?
- # TODO: If we stay at the current record,
- # TODO: how do we know the "current record"
- # TODO: or one of the earlier records wasn't
- # TODO: deleted. Or worse yet, what if our
- # TODO: "current" record is higher than the
- # TODO: actual number of records left in cache?
- if self._currentRecord >= self._resultSet.getCacheCount():
- self.switchRecord(-self._currentRecord)
+ self.jumpRecord(0)
self.mode='normal'
- #self.switchRecord(0)
#
# processRollback
Index: gnue/gnuef/src/GFObjects/GFEntry.py
diff -u gnue/gnuef/src/GFObjects/GFEntry.py:1.10
gnue/gnuef/src/GFObjects/GFEntry.py:1.11
--- gnue/gnuef/src/GFObjects/GFEntry.py:1.10 Thu Aug 30 11:48:47 2001
+++ gnue/gnuef/src/GFObjects/GFEntry.py Thu Aug 30 14:34:48 2001
@@ -169,10 +169,6 @@
# verifyValue
#
def verifyValue(self):
- # TODO: This needs to insure the allowedValues are
- # TODO: loaded if the entry type isn't dropdown
- # TODO: It's broken now cause it's time to leave
- # TODO: and I don't have time to fix it
if not self._allowedValues:
self.allowedValues()
value = 1
Index: gnue/gnuef/src/GFObjects/GFObj.py
diff -u gnue/gnuef/src/GFObjects/GFObj.py:1.6
gnue/gnuef/src/GFObjects/GFObj.py:1.7
--- gnue/gnuef/src/GFObjects/GFObj.py:1.6 Mon Aug 13 16:15:28 2001
+++ gnue/gnuef/src/GFObjects/GFObj.py Thu Aug 30 14:34:48 2001
@@ -46,8 +46,8 @@
self.readonly = 0
self._visibleIndex = 0
self.name = "__%s__" % self
- self._inits = [self.initialize]
-
+ #self._inits = [self.initialize]#
+ self._inits = []
#
# get an Option
#
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- gnue gnue-common/src/GDataObjects.py gnue-commo...,
James Thompson <=