[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gnue/gnue-common/src/dbdrivers/geas DBdriver.py
From: |
James Thompson |
Subject: |
gnue/gnue-common/src/dbdrivers/geas DBdriver.py |
Date: |
Thu, 20 Sep 2001 23:09:41 -0400 |
CVSROOT: /cvs
Module name: gnue
Changes by: James Thompson <address@hidden> 01/09/20 23:09:41
Modified files:
gnue-common/src/dbdrivers/geas: DBdriver.py
Log message:
Started adding schema discovery routines to geas driver
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-common/src/dbdrivers/geas/DBdriver.py.diff?cvsroot=OldCVS&tr1=1.14&tr2=1.15&r1=text&r2=text
Patches:
Index: gnue/gnue-common/src/dbdrivers/geas/DBdriver.py
diff -u gnue/gnue-common/src/dbdrivers/geas/DBdriver.py:1.14
gnue/gnue-common/src/dbdrivers/geas/DBdriver.py:1.15
--- gnue/gnue-common/src/dbdrivers/geas/DBdriver.py:1.14 Thu Sep 20
02:08:36 2001
+++ gnue/gnue-common/src/dbdrivers/geas/DBdriver.py Thu Sep 20 23:09:41 2001
@@ -76,12 +76,13 @@
self._fieldNames = None
GDebug.printMesg(5, 'ResultSet created')
-
def _loadNextRecord(self):
if self._cursor:
try:
print self._cursor
- #if not self._fieldNames:
+
+ if not self._fieldNames:
+ self._dataObject.getSchemaList()
# self._fieldNames = []
# for t in (self._cursor.description):
# self._fieldNames.append (t[0])
@@ -347,6 +348,45 @@
else:
raise GConditions.ConditionNotSupported, \
'Condition clause "%s" is not supported by this db driver.' % otype
+
+
+ # Return a list of the types of Schema objects this driver provides
+ # Doesn't seem to be in use anywhere yet but I'll put it in - jamest
+ def getSchemaTypes(self):
+ return [('object','Object',1)]
+
+ # Return a list of Schema objects
+ def getSchemaList(self, type=None):
+
+ # TODO: These next few lines serve no purpose in this
+ # TODO: driver but I will leave in place in case jcater
+ # TODO: had plans for this stuff in designer
+ includeObjects = (type in ('object','sources', None))
+
+ if includeObjects:
+ pass
+ # TODO: End odd stuff
+
+ list = []
+ for classname in self._dataConnection.classes:
+ print "Classname: ", classname
+ classdef = self._dataConnection.getFullClassDefinition(str(classname))
+# print "Class: %s\n Fields: %s" % (classdef.name, classdef.fields)
+# list.append(GDataObjects.Schema(attrs={'id':lower(classdef.name),
+# 'name':classdef.name,
+# 'type':'object'},
+#
getChildSchema=self.__getAttribSchema))
+
+ return list
+ #print ""
+ #classnames = con.classes
+ #idx = show_classnames( classnames )
+
+ #c = con.getFullClassDefinition( classnames[idx-1] )
+ #show_classname( c )
+ #show_fields( c )
+ #raw_input( "Press 'enter' to continue" )
+
supportedDataObjects = {
'object': GEAS_DataObject