modeling-cvs Mailing List for Object-Relational Bridge for python (Page 25)
Status: Abandoned
Brought to you by:
sbigaret
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
(54) |
Apr
(29) |
May
(94) |
Jun
(47) |
Jul
(156) |
Aug
(132) |
Sep
(40) |
Oct
(6) |
Nov
(18) |
Dec
(24) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(18) |
Feb
(59) |
Mar
(7) |
Apr
|
May
(8) |
Jun
(2) |
Jul
(12) |
Aug
(15) |
Sep
(12) |
Oct
(6) |
Nov
(25) |
Dec
(1) |
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2006 |
Jan
|
Feb
(27) |
Mar
|
Apr
(16) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <sbi...@us...> - 2003-06-24 08:58:20
|
Update of /cvsroot/modeling/ProjectModeling/Modeling In directory sc8-pr-cvs1:/tmp/cvs-serv32766 Modified Files: CHANGES Log Message: Changes: I formerly announced on the ml. that a varchar w/o width would issue a message at the INFO level --the previous changes simply discarded it Index: CHANGES =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/Modeling/CHANGES,v retrieving revision 1.113 retrieving revision 1.114 diff -C2 -d -r1.113 -r1.114 *** CHANGES 24 Jun 2003 08:51:10 -0000 1.113 --- CHANGES 24 Jun 2003 08:58:15 -0000 1.114 *************** *** 11,15 **** contains a CHAR/VARCHAR field with no width set, as long as the underlying adaptor supports it (varchar w/o width are valid for: Postgresql, SQLite), ! as Ernesto Revilla suggested it. * Fixed bug #757181: under python2.2 AccessArrayFaultHandler was triggered --- 11,16 ---- contains a CHAR/VARCHAR field with no width set, as long as the underlying adaptor supports it (varchar w/o width are valid for: Postgresql, SQLite), ! as Ernesto Revilla suggested it. Instead, it produces a message at the ! INFO level. * Fixed bug #757181: under python2.2 AccessArrayFaultHandler was triggered |
From: <sbi...@us...> - 2003-06-24 08:51:18
|
Update of /cvsroot/modeling/ProjectModeling/Modeling In directory sc8-pr-cvs1:/tmp/cvs-serv31980 Modified Files: CHANGES ModelValidation.py Log Message: Fixed: ModelValidation does not issue an error anymore when a model contains a CHAR/VARCHAR field with no width set, as long as the underlying adaptor supports it (varchar w/o width are valid for: Postgresql, SQLite), as Ernesto Revilla suggested it. Index: CHANGES =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/Modeling/CHANGES,v retrieving revision 1.112 retrieving revision 1.113 diff -C2 -d -r1.112 -r1.113 *** CHANGES 19 Jun 2003 14:19:02 -0000 1.112 --- CHANGES 24 Jun 2003 08:51:10 -0000 1.113 *************** *** 8,11 **** --- 8,16 ---- -------------------------------------------------------- + * Fixed: ModelValidation does not issue an error anymore when a model + contains a CHAR/VARCHAR field with no width set, as long as the underlying + adaptor supports it (varchar w/o width are valid for: Postgresql, SQLite), + as Ernesto Revilla suggested it. + * Fixed bug #757181: under python2.2 AccessArrayFaultHandler was triggered every time the array is accessed, instead of being fired only once. Index: ModelValidation.py =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/Modeling/ModelValidation.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ModelValidation.py 17 Jun 2003 17:01:30 -0000 1.8 --- ModelValidation.py 24 Jun 2003 08:51:10 -0000 1.9 *************** *** 42,45 **** --- 42,46 ---- WARNING=2 INFO=3 + DEBUG=4 MSGS_FOR_LEVELS={ NOT_SUPPORTED: 'Not supported feature(s)', *************** *** 47,50 **** --- 48,52 ---- WARNING: 'Warning(s)', INFO: 'Info', + DEBUG: 'Debug', } LEVELS=tuple(MSGS_FOR_LEVELS.keys()) *************** *** 62,76 **** object -- the object causing the error ! level -- valid levels are INFO, WARNING, ERROR, NOT_SUPPORTED, defined ! by the module msg -- informational message ! ignore_levels -- """ # Ignore levels if not ignore_levels: ! self._ignored_levels=() else: if type(ignore_levels) not in (type(()), type([])): --- 64,78 ---- object -- the object causing the error ! level -- valid levels are DEBUG, INFO, WARNING, ERROR, NOT_SUPPORTED, ! defined by the module msg -- informational message ! ignore_levels -- list of level to ignore. Default is (DEBUG,) """ # Ignore levels if not ignore_levels: ! self._ignored_levels=(DEBUG,) else: if type(ignore_levels) not in (type(()), type([])): *************** *** 280,288 **** errors.aggregateError('Entity %s'%entity.name(), WARNING, msgs) ! # INFO msgs=[] if not entity.typeName(): msgs.append('typeName is not defined') if msgs: ! errors.aggregateError('Entity %s'%entity.name(), INFO, msgs) --- 282,290 ---- errors.aggregateError('Entity %s'%entity.name(), WARNING, msgs) ! # DEBUG msgs=[] if not entity.typeName(): msgs.append('typeName is not defined') if msgs: ! errors.aggregateError('Entity %s'%entity.name(), DEBUG, msgs) *************** *** 334,337 **** --- 336,340 ---- else: concreteAdaptor=adaptorForModel(attribute.entity().model()) + concreteAdaptorName=attribute.entity().model().adaptorName() if not concreteAdaptor: errors.aggregateError('Attribute %s.%s'%(attribute.entity().name(), *************** *** 351,356 **** msgs.append("NUMERIC type requires both 'precision' AND 'scale'") elif extType in ('varchar', 'char'): ! if not attribute.width(): ! msgs.append("VARCHAR type requires 'width' to be set") ## really?? elif extType in ('integer',): if attribute.width() or attribute.width() or attribute.precision(): --- 354,360 ---- msgs.append("NUMERIC type requires both 'precision' AND 'scale'") elif extType in ('varchar', 'char'): ! if not attribute.width() and \ ! concreteAdaptorName not in ('Postgresql', 'SQLite'): ! msgs.append("CHAR/VARCHAR type requires 'width' to be set") elif extType in ('integer',): if attribute.width() or attribute.width() or attribute.precision(): *************** *** 367,371 **** attribute.name()), ERROR, msgs) ! ## ## Relationship --- 371,375 ---- attribute.name()), ERROR, msgs) ! ## ## Relationship |
From: <sbi...@us...> - 2003-06-24 08:51:18
|
Update of /cvsroot/modeling/ProjectModeling/Modeling/scripts In directory sc8-pr-cvs1:/tmp/cvs-serv31980/scripts Modified Files: mdl_validate_model.py Log Message: Fixed: ModelValidation does not issue an error anymore when a model contains a CHAR/VARCHAR field with no width set, as long as the underlying adaptor supports it (varchar w/o width are valid for: Postgresql, SQLite), as Ernesto Revilla suggested it. Index: mdl_validate_model.py =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/Modeling/scripts/mdl_validate_model.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** mdl_validate_model.py 22 Apr 2003 11:08:00 -0000 1.3 --- mdl_validate_model.py 24 Jun 2003 08:51:10 -0000 1.4 *************** *** 31,35 **** from Modeling.ModelSet import ModelSet from Modeling import ModelValidation as MV ! from Modeling.ModelValidation import NOT_SUPPORTED, ERROR, WARNING, INFO --- 31,35 ---- from Modeling.ModelSet import ModelSet from Modeling import ModelValidation as MV ! from Modeling.ModelValidation import NOT_SUPPORTED,ERROR,WARNING,INFO,DEBUG *************** *** 95,99 **** global quiet_mode ignore_warnings=verbose=0 ! ignore_levels=[] for k, v in options: if k in ('-h', '--help'): usage(me); return 0 --- 95,99 ---- global quiet_mode ignore_warnings=verbose=0 ! ignore_levels=[DEBUG] for k, v in options: if k in ('-h', '--help'): usage(me); return 0 |
From: <sbi...@us...> - 2003-06-19 14:19:04
|
Update of /cvsroot/modeling/ProjectModeling/Modeling/tests In directory sc8-pr-cvs1:/tmp/cvs-serv17475/tests Modified Files: test_EditingContext_Global.py Log Message: Fixed bug #757181: under python2.2 AccessArrayFaultHandler was triggered every time the array is accessed, instead of being fired only once. Also fixed test_EditingContext_Global.test_03_toManyFaultTrigger() Index: test_EditingContext_Global.py =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/Modeling/tests/test_EditingContext_Global.py,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** test_EditingContext_Global.py 12 Jun 2003 11:40:33 -0000 1.22 --- test_EditingContext_Global.py 19 Jun 2003 14:19:02 -0000 1.23 *************** *** 211,219 **** adaptorChannel=concreteAdaptorChannelForEntity('Writer', ec) - fetchCount=adaptorChannel._count_for_execute books=dard.getBooks() ! self.failUnless(len(books)==3) self.failUnless(books[0]) # just test access w/ __getitem__ ! self.failIf(adaptorChannel._count_for_execute==fetchCount) # Last, check that the original object containing the toMany fault was not --- 211,221 ---- adaptorChannel=concreteAdaptorChannelForEntity('Writer', ec) books=dard.getBooks() ! self.failUnless(len(books)==3) # triggers the fault ! fetchCount=adaptorChannel._count_for_execute ! # all subsequent accesses to the AccessArrayFaultHandler should not ! # trigger the already-fired-fault self.failUnless(books[0]) # just test access w/ __getitem__ ! self.failUnless(adaptorChannel._count_for_execute==fetchCount) # Last, check that the original object containing the toMany fault was not |
From: <sbi...@us...> - 2003-06-19 14:19:04
|
Update of /cvsroot/modeling/ProjectModeling/Modeling In directory sc8-pr-cvs1:/tmp/cvs-serv17475 Modified Files: FaultHandler.py CHANGES Log Message: Fixed bug #757181: under python2.2 AccessArrayFaultHandler was triggered every time the array is accessed, instead of being fired only once. Also fixed test_EditingContext_Global.test_03_toManyFaultTrigger() Index: FaultHandler.py =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/Modeling/FaultHandler.py,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** FaultHandler.py 14 Mar 2003 11:40:08 -0000 1.13 --- FaultHandler.py 19 Jun 2003 14:19:02 -0000 1.14 *************** *** 450,457 **** # return l ! if sys.version_info >= (2, 2): # python v2.2 and higher **UNTESTED** def __getattr__(self, name): if name in self.__sequenceTypeMethods: ! self.completeInitializationOfObject(self.__object()) #trace(self.__object().storedValueForKey(self._relationshipName)) --- 450,458 ---- # return l ! if sys.version_info >= (2, 2): # python v2.2 and higher def __getattr__(self, name): if name in self.__sequenceTypeMethods: ! if not self.__list: ! self.completeInitializationOfObject(self.__object()) #trace(self.__object().storedValueForKey(self._relationshipName)) Index: CHANGES =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/Modeling/CHANGES,v retrieving revision 1.111 retrieving revision 1.112 diff -C2 -d -r1.111 -r1.112 *** CHANGES 17 Jun 2003 17:01:30 -0000 1.111 --- CHANGES 19 Jun 2003 14:19:02 -0000 1.112 *************** *** 8,11 **** --- 8,14 ---- -------------------------------------------------------- + * Fixed bug #757181: under python2.2 AccessArrayFaultHandler was triggered + every time the array is accessed, instead of being fired only once. + * Fixed: adaptorModel() could raise instead of returning None when model's adaptorName is not set |
Update of /cvsroot/modeling/ProjectModeling/Modeling/tests In directory sc8-pr-cvs1:/tmp/cvs-serv7100/tests Modified Files: Tag: brch-0_9pre7-1-PyModel test_EditingContext_Global.py test_EditingContext_Global_Inheritance.py test_EditingContext_ParentChild.py Log Message: ModelSet.updateModelWithCFG() deprecated, moved to Model Index: test_EditingContext_Global.py =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/Modeling/tests/test_EditingContext_Global.py,v retrieving revision 1.20 retrieving revision 1.20.2.1 diff -C2 -d -r1.20 -r1.20.2.1 *** test_EditingContext_Global.py 7 May 2003 11:27:10 -0000 1.20 --- test_EditingContext_Global.py 17 Jun 2003 17:12:34 -0000 1.20.2.1 *************** *** 40,44 **** utils.fixpath() ! from Modeling import ModelSet from Modeling.EditingContext import EditingContext from Modeling.FetchSpecification import FetchSpecification --- 40,44 ---- utils.fixpath() ! from Modeling import ModelSet, Model from Modeling.EditingContext import EditingContext from Modeling.FetchSpecification import FetchSpecification *************** *** 1041,1045 **** author_books_model=ModelSet.defaultModelSet().modelNamed('AuthorBooks') # Initialization of model's caracs. ! ModelSet.updateModelWithCFG(author_books_model, database_cfg) # MySQL specifics: change TIMESTAMP to DATETIME --- 1041,1045 ---- author_books_model=ModelSet.defaultModelSet().modelNamed('AuthorBooks') # Initialization of model's caracs. ! Model.updateModelWithCFG(author_books_model, database_cfg) # MySQL specifics: change TIMESTAMP to DATETIME Index: test_EditingContext_Global_Inheritance.py =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/Modeling/tests/test_EditingContext_Global_Inheritance.py,v retrieving revision 1.9 retrieving revision 1.9.2.1 diff -C2 -d -r1.9 -r1.9.2.1 *** test_EditingContext_Global_Inheritance.py 7 May 2003 11:27:10 -0000 1.9 --- test_EditingContext_Global_Inheritance.py 17 Jun 2003 17:12:34 -0000 1.9.2.1 *************** *** 40,44 **** utils.fixpath() ! from Modeling import ModelSet from Modeling.EditingContext import EditingContext from Modeling.FetchSpecification import FetchSpecification --- 40,44 ---- utils.fixpath() ! from Modeling import ModelSet, Model from Modeling.EditingContext import EditingContext from Modeling.FetchSpecification import FetchSpecification *************** *** 418,422 **** # Initialization of model's caracs. model=ModelSet.defaultModelSet().modelNamed('StoreEmployees') ! ModelSet.updateModelWithCFG(model, database_cfg) if reinitDB_flag: reinitDB(); return --- 418,422 ---- # Initialization of model's caracs. model=ModelSet.defaultModelSet().modelNamed('StoreEmployees') ! Model.updateModelWithCFG(model, database_cfg) if reinitDB_flag: reinitDB(); return Index: test_EditingContext_ParentChild.py =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/Modeling/tests/test_EditingContext_ParentChild.py,v retrieving revision 1.7 retrieving revision 1.7.2.1 diff -C2 -d -r1.7 -r1.7.2.1 *** test_EditingContext_ParentChild.py 7 May 2003 11:27:10 -0000 1.7 --- test_EditingContext_ParentChild.py 17 Jun 2003 17:12:34 -0000 1.7.2.1 *************** *** 18,22 **** utils.fixpath() ! from Modeling import ModelSet from Modeling.EditingContext import EditingContext from Modeling.FetchSpecification import FetchSpecification --- 18,22 ---- utils.fixpath() ! from Modeling import ModelSet, Model from Modeling.EditingContext import EditingContext from Modeling.FetchSpecification import FetchSpecification *************** *** 534,539 **** store_employee_model=ModelSet.defaultModelSet().modelNamed('StoreEmployees') # Initialization of model's caracs. ! ModelSet.updateModelWithCFG(author_books_model, database_cfg) ! ModelSet.updateModelWithCFG(store_employee_model, database_cfg) # MySQL specifics: change TIMESTAMP to DATETIME --- 534,539 ---- store_employee_model=ModelSet.defaultModelSet().modelNamed('StoreEmployees') # Initialization of model's caracs. ! Model.updateModelWithCFG(author_books_model, database_cfg) ! Model.updateModelWithCFG(store_employee_model, database_cfg) # MySQL specifics: change TIMESTAMP to DATETIME |
From: <sbi...@us...> - 2003-06-17 17:04:28
|
Update of /cvsroot/modeling/ProjectModeling/Modeling/tests/testPackages/StoreEmployees In directory sc8-pr-cvs1:/tmp/cvs-serv5757/tests/testPackages/StoreEmployees Modified Files: Tag: brch-0_9pre7-1-PyModel pymodel_StoreEmployees.py Log Message: Modified so that Model.searchModel can find & load the PyModel Index: pymodel_StoreEmployees.py =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/Modeling/tests/testPackages/StoreEmployees/Attic/pymodel_StoreEmployees.py,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -C2 -d -r1.1.2.3 -r1.1.2.4 *** pymodel_StoreEmployees.py 19 May 2003 10:37:23 -0000 1.1.2.3 --- pymodel_StoreEmployees.py 17 Jun 2003 17:04:24 -0000 1.1.2.4 *************** *** 18,25 **** Association.defaults['delete']=['nullify', 'nullify'] - # Note that Relation.attNameFromRel is a callable, that calculates the att - # name from the indicated pieces (where count to distinguish between multiple - # relations between same source and target - Entity.defaults['properties'] = [ APrimaryKey('id', isClassProperty=0, isRequired=1, doc='Primary key!') --- 18,21 ---- *************** *** 28,92 **** ## ! _connDict = {'database': 'STORE_EMPLOYEES'} ! model = Model('StoreEmployees',adaptorName='Postgresql', ! connDict=_connDict) ! model.doc = ' ... ' ! model.version='0.1' ! model.entities = [ ! ! # ! Entity('Store', ! properties=[ AString('corporateName', isRequired=1), ], ! ), ! ! Entity('Employee', ! properties=[ AString('lastName',isRequired=1,usedForLocking=1, ! width=20), ! AString('firstName', isRequired=1, width=50, ! usedForLocking=1), ! ] ! ), ! Entity('SalesClerk', parent='Employee', ! properties=[ AString('storeArea', width=20) ] ! ), ! ! Entity('Executive', parent='Employee', ! properties=[ AString('officeLocation', width=5) ] ! ), ! ! Entity('Address', ! properties=[ AString('street', width=80), ! AString('zipCode', width=10), ! AString('town'), ! ] ! ), ! ! Entity('Mark', ! properties=[ AInteger('month', isRequired=1), ! AInteger('mark', isRequired=1), ! ] ! ) - ] - model.associations=[ - Association('Mark', 'Executive', - relations=['executive', 'marks'], - delete=['nullify', 'cascade'], - keys=['FK_Executive_id', 'id']), - Association('Address', 'Employee', - relations=['toEmployee', 'toAddresses'], - delete=['deny', 'cascade'], - keys=['fkEmployeeId', 'id'], - ), - Association('Employee', 'Store', - relations=['toStore', 'employees'], - delete=['nullify', 'deny'], - keys=['fkStoreId', 'id']), - ] - if __name__ == '__main__': model.build() ! #print model.validate() ! #print model.toXML() ! # plus whatever ... ! ## --- 24,82 ---- ## ! def pymodel(): ! _connDict = {'database': 'STORE_EMPLOYEES'} ! model = Model('StoreEmployees',adaptorName='Postgresql', ! connDict=_connDict) ! model.doc = ' ... ' ! model.version='0.1' ! model.entities = [ ! # ! Entity('Store', ! properties=[ AString('corporateName', isRequired=1), ], ! ), ! Entity('Employee', ! properties=[ AString('lastName',isRequired=1,usedForLocking=1, ! width=20), ! AString('firstName', isRequired=1, width=50, ! usedForLocking=1), ! ] ! ), ! Entity('SalesClerk', parent='Employee', ! properties=[ AString('storeArea', width=20) ] ! ), ! Entity('Executive', parent='Employee', ! properties=[ AString('officeLocation', width=5) ] ! ), ! Entity('Address', ! properties=[ AString('street', width=80), ! AString('zipCode', width=10), ! AString('town'), ! ] ! ), ! Entity('Mark', ! properties=[ AInteger('month', isRequired=1), ! AInteger('mark', isRequired=1), ! ] ! ) ! ] ! model.associations=[ ! Association('Mark', 'Executive', ! relations=['executive', 'marks'], ! delete=['nullify', 'cascade'], ! keys=['FK_Executive_id', 'id']), ! Association('Address', 'Employee', ! relations=['toEmployee', 'toAddresses'], ! delete=['deny', 'cascade'], ! keys=['fkEmployeeId', 'id'], ! ), ! Association('Employee', 'Store', ! relations=['toStore', 'employees'], ! delete=['nullify', 'deny'], ! keys=['fkStoreId', 'id']), ! ] model.build() ! return model ! def model(): ! return pymodel().component |
From: <sbi...@us...> - 2003-06-17 17:03:57
|
Update of /cvsroot/modeling/ProjectModeling/Modeling/tests/testPackages/StoreEmployees In directory sc8-pr-cvs1:/tmp/cvs-serv5668/tests/testPackages/StoreEmployees Modified Files: Tag: brch-0_9pre7-1-PyModel __init__.py Log Message: Modified so that it uses Model.searchModel() Index: __init__.py =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/Modeling/tests/testPackages/StoreEmployees/__init__.py,v retrieving revision 1.2.4.1 retrieving revision 1.2.4.2 diff -C2 -d -r1.2.4.1 -r1.2.4.2 *** __init__.py 18 May 2003 15:26:25 -0000 1.2.4.1 --- __init__.py 17 Jun 2003 17:03:55 -0000 1.2.4.2 *************** *** 1,51 **** # Load the model ! from Modeling import ModelSet ! import os, warnings, StringIO, traceback ! ! try: ! if ModelSet.defaultModelSet().modelNamed("StoreEmployees") is None: ! from pymodel_StoreEmployees import model ! model.build() ! ModelSet.defaultModelSet().addModel(model.component) ! model=ModelSet.defaultModelSet().modelNamed('StoreEmployees') ! except: ! exc=StringIO.StringIO() ! traceback.print_exc(file=exc) ! warnings.warn("Couldn't load model from pymodel_StoreEmployee.py\nReason:\n%s"%exc.getvalue()) ! del exc ! ! ! try: ! if ModelSet.defaultModelSet().modelNamed("StoreEmployees") is None: ! from model_StoreEmployees import model_src ! ModelSet.defaultModelSet().addModelFromXML({'string': model_src}) ! del model_src ! model=ModelSet.defaultModelSet().modelNamed('StoreEmployees') ! except: ! exc=StringIO.StringIO() ! traceback.print_exc(file=exc) ! warnings.warn("Couldn't load model 'model_StoreEmployees.xml'\nReason:\n%s"%exc.getvalue()) ! del exc ! del os, warnings, StringIO, traceback ! # Or, alternatively: use the xml file (ok for dev. mode, not for install w/ ! # distutils) ! # ! # from Modeling import ModelSet ! # import os, warnings, StringIO, traceback ! # try: ! # if ModelSet.defaultModelSet().modelNamed("StoreEmployees") is None: ! # from os import getcwd, path ! # mydir = os.path.abspath(os.path.dirname(__file__)) ! # xmlmodelPath=path.join(mydir,'model_StoreEmployees.xml') ! # ModelSet.defaultModelSet().addModelFromXML({'file': xmlmodelPath}) ! # model=ModelSet.defaultModelSet().modelNamed('StoreEmployees') ! # except: ! # exc=StringIO.StringIO() ! # traceback.print_exc(file=exc) ! # warnings.warn("Couldn't load model 'model_StoreEmployees.xml'\nReason:\n%s"%exc.getvalue()) ! # del exc ! # ! # del os, warnings, StringIO, traceback --- 1,14 ---- # Load the model ! from Modeling import ModelSet, Model ! if ModelSet.defaultModelSet().modelNamed("StoreEmployees") is None: ! import os ! mydir = os.path.abspath(os.path.dirname(__file__)) ! model=Model.searchModel('StoreEmployees', mydir, verbose=0) ! if not model: ! import warnings ! warnings.warn("Couldn't load model 'StoreEmployees'") ! else: ! ModelSet.defaultModelSet().addModel(model) |
From: <sbi...@us...> - 2003-06-17 17:03:34
|
Update of /cvsroot/modeling/ProjectModeling/Modeling/tests In directory sc8-pr-cvs1:/tmp/cvs-serv5611/tests Modified Files: Tag: brch-0_9pre7-1-PyModel test_Model.py Log Message: Added tests for loadModel() Index: test_Model.py =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/Modeling/tests/test_Model.py,v retrieving revision 1.3 retrieving revision 1.3.6.1 diff -C2 -d -r1.3 -r1.3.6.1 *** test_Model.py 10 Feb 2003 11:32:38 -0000 1.3 --- test_Model.py 17 Jun 2003 17:03:31 -0000 1.3.6.1 *************** *** 31,36 **** from Modeling import Model class TestModel(unittest.TestCase): ! "Empty for now" def test_truc(self): "[Model] Tests that 1 is equal to 1" --- 31,70 ---- from Modeling import Model + class TestModuleFunctions(unittest.TestCase): + "Tests for module Model" + def checkStoreEmployee(self, model): + "Minimum checking of model StoreEmployees" + entities=('Store','Employee','Executive','SalesClerk','Mark','Address') + self.failIf(len(model.entities()) != len(entities)) + for e in entities: + self.failIf(e not in model.entitiesNames(), "%s not in model"%e) + + def test_01_loadModel(self): + "[module Model] loadModel" + from Modeling.ModelSet import defaultModelSet + self.assertRaises(IOError, Model.loadModel, + 'testPackages/StoreEmployees/does_not_exists.py') + self.assertRaises(IOError, Model.loadModel, + 'testPackages/StoreEmployees/does_not_exists.xml') + self.assertRaises(IOError, Model.loadModel, + 'testPackages/StoreEmployees/Mark.py') + # PyModel + model=Model.loadModel('testPackages/StoreEmployees/pymodel_StoreEmployees.py') + self.failUnless(model) + self.failIf(model in defaultModelSet().models()) + self.checkStoreEmployee(model) + # xml-model in .py + model=Model.loadModel('testPackages/StoreEmployees/model_StoreEmployees.py') + self.failUnless(model) + self.failIf(model in defaultModelSet().models()) + self.checkStoreEmployee(model) + # xml-model in .xml + model=Model.loadModel('testPackages/StoreEmployees/model_StoreEmployees.xml') + self.failUnless(model) + self.failIf(model in defaultModelSet().models()) + self.checkStoreEmployee(model) + class TestModel(unittest.TestCase): ! "Tests for class Model. Empty for now" def test_truc(self): "[Model] Tests that 1 is equal to 1" *************** *** 40,43 **** --- 74,78 ---- def test_suite(): suite = unittest.TestSuite() + suite.addTest(unittest.makeSuite(TestModuleFunctions, "test_")) suite.addTest(unittest.makeSuite(TestModel, "test_")) return suite |
From: <sbi...@us...> - 2003-06-17 17:01:35
|
Update of /cvsroot/modeling/ProjectModeling/Modeling In directory sc8-pr-cvs1:/tmp/cvs-serv5043 Modified Files: ModelValidation.py CHANGES Log Message: Fixed: adaptorModel() could raise instead of returning None when model's adaptorName is not set Index: ModelValidation.py =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/Modeling/ModelValidation.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ModelValidation.py 11 Jun 2003 11:10:12 -0000 1.7 --- ModelValidation.py 17 Jun 2003 17:01:30 -0000 1.8 *************** *** 490,494 **** try: concreteAdaptor=Adaptor.adaptorWithName(model.adaptorName()) ! except AdaptorImportError: ! pass return concreteAdaptor --- 490,494 ---- try: concreteAdaptor=Adaptor.adaptorWithName(model.adaptorName()) ! except AdaptorImportError: pass ! except ValueError: pass return concreteAdaptor Index: CHANGES =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/Modeling/CHANGES,v retrieving revision 1.110 retrieving revision 1.111 diff -C2 -d -r1.110 -r1.111 *** CHANGES 12 Jun 2003 11:40:30 -0000 1.110 --- CHANGES 17 Jun 2003 17:01:30 -0000 1.111 *************** *** 8,11 **** --- 8,14 ---- -------------------------------------------------------- + * Fixed: adaptorModel() could raise instead of returning None when model's + adaptorName is not set + * Fixed: PostgresqlSQLExpression was not correctly escaping '%' (postgresql interprets the backslash char just like python does, hence escaping '%' |
From: <sbi...@us...> - 2003-06-17 16:59:34
|
Update of /cvsroot/modeling/ProjectModeling/Modeling In directory sc8-pr-cvs1:/tmp/cvs-serv4681 Modified Files: Tag: brch-0_9pre7-1-PyModel ModelValidation.py Log Message: Fixed: adaptorModel() could raise instead of returning None when model's adaptorName is not set Index: ModelValidation.py =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/Modeling/ModelValidation.py,v retrieving revision 1.6 retrieving revision 1.6.6.1 diff -C2 -d -r1.6 -r1.6.6.1 *** ModelValidation.py 14 Mar 2003 14:33:40 -0000 1.6 --- ModelValidation.py 17 Jun 2003 16:59:31 -0000 1.6.6.1 *************** *** 490,494 **** try: concreteAdaptor=Adaptor.adaptorWithName(model.adaptorName()) ! except AdaptorImportError: ! pass return concreteAdaptor --- 490,494 ---- try: concreteAdaptor=Adaptor.adaptorWithName(model.adaptorName()) ! except AdaptorImportError: pass ! except ValueError: pass return concreteAdaptor |
From: <sbi...@us...> - 2003-06-17 16:57:46
|
Update of /cvsroot/modeling/ProjectModeling/Modeling In directory sc8-pr-cvs1:/tmp/cvs-serv4314 Modified Files: Tag: brch-0_9pre7-1-PyModel ModelSet.py Log Message: Deprecated method: updateModelWithCFG() --moved in Model Index: ModelSet.py =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/Modeling/ModelSet.py,v retrieving revision 1.7 retrieving revision 1.7.2.1 diff -C2 -d -r1.7 -r1.7.2.1 *** ModelSet.py 7 May 2003 11:28:45 -0000 1.7 --- ModelSet.py 17 Jun 2003 16:57:43 -0000 1.7.2.1 *************** *** 100,161 **** def updateModelWithCFG(model, cfg_path): """ ! Updates the model's connection dictionary and adaptorName with the values ! in file 'cfg_path'. ! ! A sample configuration file is like:: ! ! [DEFAULT] ! host: localhost ! ! [ModelName_1] ! user: user_1 ! password: pwd_1 ! ! [ModelName_2] ! adaptor: MySQL ! user: user_2 ! password: pwd_2 ! ! The special field 'adaptor', if present, changes the adaptorName of the ! model. ! ! Raises IOError if file 'cfg_path' cannot be found. ! ! See also: ModelSet.addModel() ! ! Parameters: ! ! model -- the model whose conn.dict. should be updated ! ! cfg_path -- the full path to the configuration file ! """ ! from ConfigParser import ConfigParser ! import os ! defaults=model.connectionDictionary() ! cp=ConfigParser() ! try: ! cp.readfp(open(cfg_path)) ! except IOError: ! import traceback, cStringIO, sys ! exc_raised=sys.exc_info()[:2] ! err_msg="Unable to open file '%s' pointed by env. variable MDL_DB_CONNECTIONS_CFG"%cfg_path ! exc=cStringIO.StringIO() ! traceback.print_exception(exc_raised[0], exc_raised[1], None, file=exc) ! err_msg+="\nOriginal exception was: %s"%exc.getvalue() ! raise IOError, err_msg - try: options=cp.options(model.name()) - except: return - try: options.remove('adaptor') - except ValueError: pass - for key in options: - defaults[key]=cp.get(model.name(), key) - model.setConnectionDictionary(defaults) - try: - model.setAdaptorName(cp.get(model.name(), 'adaptor')) - except: - pass - class ModelSet(Persistent): """Holds a set of Modeling.Models that can co-exist at runtime --- 100,110 ---- def updateModelWithCFG(model, cfg_path): """ ! Deprecated: use Model.updateModelWithCFG instead. This method will be ! removed in v0.9.1 """ ! import warnings ! warnings.warn("ModelSet.updateModelWithCFG() is deprecated: use Model.updateModelWithCFG() instead. This method will be removed in v0.9.1", DeprecationWarning) ! return Model.updateModelWithCFG(model, cfg_path) class ModelSet(Persistent): """Holds a set of Modeling.Models that can co-exist at runtime *************** *** 184,188 **** If the environment variable 'MDL_DB_CONNECTIONS_CFG' is set, the file it points to is used to update aModel's connection dictionary (and ! possibly its adaptorName as well). See updateModelWithCFG() for details. """ #assert --- 133,138 ---- If the environment variable 'MDL_DB_CONNECTIONS_CFG' is set, the file it points to is used to update aModel's connection dictionary (and ! possibly its adaptorName as well). See Model.updateModelWithCFG() for ! details. """ #assert *************** *** 204,209 **** cfg_path=os.environ.get('MDL_DB_CONNECTIONS_CFG') if cfg_path: updateModelWithCFG(aModel, cfg_path) ! # XML Import/Export facilities def addModelFromXML(self, xmlSource): --- 154,160 ---- cfg_path=os.environ.get('MDL_DB_CONNECTIONS_CFG') if cfg_path: + from Model import updateModelWithCFG updateModelWithCFG(aModel, cfg_path) ! # XML Import/Export facilities def addModelFromXML(self, xmlSource): |
From: <sbi...@us...> - 2003-06-17 16:55:57
|
Update of /cvsroot/modeling/ProjectModeling/Modeling In directory sc8-pr-cvs1:/tmp/cvs-serv4177 Modified Files: Tag: brch-0_9pre7-1-PyModel Model.py Log Message: Added updateModelWithCFG(), loadModel(), searchModel() Index: Model.py =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/Modeling/Model.py,v retrieving revision 1.4.2.1 retrieving revision 1.4.2.2 diff -C2 -d -r1.4.2.1 -r1.4.2.2 *** Model.py 15 May 2003 17:44:20 -0000 1.4.2.1 --- Model.py 17 Jun 2003 16:55:54 -0000 1.4.2.2 *************** *** 49,52 **** --- 49,236 ---- from Persistent import Persistent + def updateModelWithCFG(model, cfg_path=None): + """ + Updates the model's connection dictionary and adaptorName with the values + in file 'cfg_path'. If cfg_path is omitted or None, the value stored + in the environment variable MDL_DB_CONNECTIONS_CFG is used instead. + + A sample configuration file is like:: + + [DEFAULT] + host: localhost + + [ModelName_1] + user: user_1 + password: pwd_1 + + [ModelName_2] + adaptor: MySQL + user: user_2 + password: pwd_2 + + The special field 'adaptor', if present, changes the adaptorName of the + model. + + Raises IOError if file 'cfg_path' cannot be found. + + See also: ModelSet.addModel() + + Parameters: + + model -- the model whose conn.dict. should be updated + + cfg_path -- the full path to the configuration file, or if omitted or + None, defaults to the value stored in the env. variable + MDL_DB_CONNECTIONS_CFG + + """ + import os + if cfg_path is None: + cfg_path=os.environ.get('MDL_DB_CONNECTIONS_CFG') + + from ConfigParser import ConfigParser + defaults=model.connectionDictionary() + cp=ConfigParser() + try: + cp.readfp(open(cfg_path)) + except IOError: + import traceback, cStringIO, sys + exc_raised=sys.exc_info()[:2] + err_msg="Unable to open file '%s' (passed in parameter 'cfg_path' or taken from env. variable MDL_DB_CONNECTIONS_CFG"%cfg_path + exc=cStringIO.StringIO() + traceback.print_exception(exc_raised[0], exc_raised[1], None, file=exc) + err_msg+="\nOriginal exception was: %s"%exc.getvalue() + raise IOError, err_msg + + try: options=cp.options(model.name()) + except: return + try: options.remove('adaptor') + except ValueError: pass + for key in options: + defaults[key]=cp.get(model.name(), key) + model.setConnectionDictionary(defaults) + try: + model.setAdaptorName(cp.get(model.name(), 'adaptor')) + except: + pass + + def loadModel(path): + """ + Load a model stored in the file 'path'. The lookup procedure is: + + - if path ends with '.py', we assume it is a python module. This module is + imported and the following attributes are searched within it, in that + order: + + 1. 'model' (either an attribute or a function): if found, we assume + this is an instance of Modeling.Model.Model and we return the value + + 2. 'pymodel' (id.): if found, we assume this is an instance of + Modeling.PyModel.Model and we return its 'component' attribute + + 3. 'model_src' (id.): if found, we assume this is a string and return + the model build from it with ModelSet.addModelFromXML() + + - if path ends with '.xml', we assume this is a xml-file and we return the + model build with ModelSet.addModelFromXML() + + Returns: the loaded Modeling.Model.Model instance + + Raises IOError if file 'path' cannot be found + + Parameter: + + path -- the path of the file where the model is stored + + """ + if path[-3:]=='.py': + import os,imp + dir,filename=os.path.dirname(path),os.path.basename(path) + modulename=filename[:-3] + file=None + try: + try: + file,pathname,description=imp.find_module(modulename, [dir]) + module=imp.load_module(modulename,file,pathname,description) + + if hasattr(module, 'model'): + model=module.model + if callable(model): + model=model() + updateModelWithCFG(model) + return model + + if hasattr(module, 'pymodel'): + model=module.pymodel + if callable(pymodel): + pymodel=pymodel() + updateModelWithCFG(pymodel.component) + return pymodel.component + + if hasattr(module, 'model_src'): + model_src=module.model_src + if callable(model_src): + model_src=model_src() + from ModelSet import ModelSet + model=ModelSet().addModelFromXML({'string': model_src}) + updateModelWithCFG(model) + return model + + raise IOError, "Couldn't find any of these attributes in python file '%s': model, pymodel (PyModel) or model_src (xml)"%path + + except: + import cStringIO, traceback + exc=cStringIO.StringIO() + traceback.print_exc(file=exc) + raise IOError, 'Unable to handle python file %s\nReason: exception raised:\n%s'%(path,exc.getvalue()) + + finally: + if file: file.close() + elif path[-4:]=='.xml': + from ModelSet import ModelSet + return ModelSet().addModelFromXML({'file': path}) + + else: + raise IOError, 'Unable to load file %s'%path + + def searchModel(modelName, path=None, verbose=0): + """ + Searches for the model named 'modelName' by trying loadModel() with the + following paths: 'pymodel_<modelName>.py', 'model_<modelName>.py' and + 'model_<modelName>.xml' in the current directory and the MDL/ directory. + + Returns the model, or None if it cannot be found/loaded + + """ + if verbose: + import sys + mylog=lambda msg, stderr=sys.stderr:stderr.write('[Model.searchModel] %s\n'%msg) + else: + mylog=lambda msg: None + + searchList=('pymodel_%s.py', 'model_%s.py', 'model_%s.xml', + 'MDL/pymodel_%s.py', 'MDL/model_%s.py', 'MDL/model_%s.xml') + for file in searchList: + model=None + file=file%modelName + if path: + import os + file=os.path.join(path, file) + try: + mylog('Trying %s'%file) + model=loadModel(file) + except IOError: + import cStringIO, traceback + exc=cStringIO.StringIO() + traceback.print_exc(file=exc) + mylog('Not found: %s\n Exception:%s'%(file,exc.getvalue())) + del exc + pass + if model: + return model + mylog('Not found: %s'%file) + mylog('modelName %s: All possibilities exhausted -- returning None'%modelName) + return None + class Model(Persistent, XMLCapability, KeyValueCoding): "Describes a model" |
From: <sbi...@us...> - 2003-06-13 11:01:03
|
Update of /cvsroot/modeling/ProjectModeling/Modeling In directory sc8-pr-cvs1:/tmp/cvs-serv6121 Modified Files: TODO Log Message: Added comments on refactoring Model, Entity, Attribute and Relationship Index: TODO =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/Modeling/TODO,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** TODO 12 Jun 2003 11:37:21 -0000 1.11 --- TODO 13 Jun 2003 11:00:58 -0000 1.12 *************** *** 94,97 **** --- 94,109 ---- refactored. + - about that refactoring: the classes used at runtime and the one used in + the ZModeler should probably be split in two different + packages. Basically, when we feel stuck on a particular issue with the + ZModeler, most of the time it's because we do not want to introduce an + extra payload at runtime for a ZModeler's given fuctionality. Note that's + it's already the case, since some code within these classes is already + dedicated to handling both situation at a time (ZModeling, and runtime + manipulation of a model) + + After the support for Pymodels are released, the refactoring might be more + easily done. + - Attribute: accepts both 'string' and 'str' for internalType(). This is because StringType.__name__ is 'string' in py2.1 and 'str' in py2.2 |
From: <sbi...@us...> - 2003-06-12 11:41:06
|
Update of /cvsroot/modeling/ProjectModeling/Modeling/DatabaseAdaptors/PostgresqlAdaptorLayer In directory sc8-pr-cvs1:/tmp/cvs-serv5313/DatabaseAdaptors/PostgresqlAdaptorLayer Modified Files: PostgresqlSQLExpression.py Log Message: Fixed: PostgresqlSQLExpression was not correctly escaping '%' (postgresql interprets the backslash char just like python does, hence escaping '%' requires a double backslash in the SQL query) Index: PostgresqlSQLExpression.py =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/Modeling/DatabaseAdaptors/PostgresqlAdaptorLayer/PostgresqlSQLExpression.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PostgresqlSQLExpression.py 10 Jun 2003 17:30:34 -0000 1.3 --- PostgresqlSQLExpression.py 12 Jun 2003 11:40:31 -0000 1.4 *************** *** 36,39 **** --- 36,40 ---- from Modeling.SQLExpression import SQLExpression, DateType, CharacterType import string + import re class PostgresqlSQLExpression(SQLExpression): *************** *** 79,82 **** --- 80,99 ---- return attribute.externalType() + def sqlPatternFromShellPatternWithEscapeCharacter(self, pattern, escapeChar): + """ + Overrides default behaviour so that '%' is changed to '\\%' instead of + '\%': postgresql interprets backslashes in strings + """ + star=re.compile('\*') + question_mark=re.compile('\?') + percent=re.compile('%') + underscore=re.compile('_') + + pattern=percent.sub('\\\\\\\\%', pattern) + pattern=underscore.sub('\_', pattern) + pattern=question_mark.sub('_', pattern) + pattern=star.sub('%', pattern) + return pattern + def valueTypeForExternalTypeMapping(self): """ |
From: <sbi...@us...> - 2003-06-12 11:41:05
|
Update of /cvsroot/modeling/ProjectModeling/Modeling In directory sc8-pr-cvs1:/tmp/cvs-serv5313 Modified Files: CHANGES Log Message: Fixed: PostgresqlSQLExpression was not correctly escaping '%' (postgresql interprets the backslash char just like python does, hence escaping '%' requires a double backslash in the SQL query) Index: CHANGES =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/Modeling/CHANGES,v retrieving revision 1.109 retrieving revision 1.110 diff -C2 -d -r1.109 -r1.110 *** CHANGES 12 Jun 2003 09:35:19 -0000 1.109 --- CHANGES 12 Jun 2003 11:40:30 -0000 1.110 *************** *** 8,11 **** --- 8,15 ---- -------------------------------------------------------- + * Fixed: PostgresqlSQLExpression was not correctly escaping '%' (postgresql + interprets the backslash char just like python does, hence escaping '%' + requires a double backslash in the SQL query) + * Fixed bug #753147: fetching twice or more with a given FetchSpecification did not return the same result set (the original FetchSpec was modified) |
From: <sbi...@us...> - 2003-06-12 11:40:40
|
Update of /cvsroot/modeling/ProjectModeling/Modeling/tests In directory sc8-pr-cvs1:/tmp/cvs-serv5313/tests Modified Files: test_EditingContext_Global.py Log Message: Fixed: PostgresqlSQLExpression was not correctly escaping '%' (postgresql interprets the backslash char just like python does, hence escaping '%' requires a double backslash in the SQL query) Index: test_EditingContext_Global.py =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/Modeling/tests/test_EditingContext_Global.py,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** test_EditingContext_Global.py 11 Jun 2003 11:10:18 -0000 1.21 --- test_EditingContext_Global.py 12 Jun 2003 11:40:33 -0000 1.22 *************** *** 878,881 **** --- 878,889 ---- self.failUnless(b.getId() == gid.keyValues()['id']) + def test_18_percent_in_qualifiers_should_be_correctly_escaped(self): + "[EditingContext] percent in qualifiers should be correctly escaped" + q=qualifierWithQualifierFormat('title like "G%"') + fs=FetchSpecification('Book', qualifier=q) + ec=EditingContext() + objs=ec.objectsWithFetchSpecification(fs) + self.failIf(objs) + def test_999_customSQLQuery(self): "[EditingContext] customSQLQuery" |
From: <sbi...@us...> - 2003-06-12 11:38:09
|
Update of /cvsroot/modeling/ProjectModeling/Modeling/tests In directory sc8-pr-cvs1:/tmp/cvs-serv3943/tests Modified Files: test_EditingContext_Global_Inheritance.py Log Message: Fixed: used '%' instead of '*' in a quelifier string Index: test_EditingContext_Global_Inheritance.py =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/Modeling/tests/test_EditingContext_Global_Inheritance.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** test_EditingContext_Global_Inheritance.py 12 Jun 2003 09:35:20 -0000 1.11 --- test_EditingContext_Global_Inheritance.py 12 Jun 2003 11:38:06 -0000 1.12 *************** *** 261,265 **** ec = EC() ! q = qWQF('toAddresses.zipCode like "4%"') fs_deep = FS('Employee', qualifier=q, deepFlag=1) # Note the deepFlag objs1=ec.objectsWithFetchSpecification(fs_deep) --- 261,265 ---- ec = EC() ! q = qWQF('toAddresses.zipCode like "4*"') fs_deep = FS('Employee', qualifier=q, deepFlag=1) # Note the deepFlag objs1=ec.objectsWithFetchSpecification(fs_deep) *************** *** 268,272 **** objs2=ec.objectsWithFetchSpecification(fs_deep) self.failIf(len(objs2)!=3) ! def tearDown(self): """ --- 268,272 ---- objs2=ec.objectsWithFetchSpecification(fs_deep) self.failIf(len(objs2)!=3) ! def tearDown(self): """ |
From: <sbi...@us...> - 2003-06-12 11:37:24
|
Update of /cvsroot/modeling/ProjectModeling/Modeling In directory sc8-pr-cvs1:/tmp/cvs-serv3465 Modified Files: TODO Log Message: Updated Index: TODO =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/Modeling/TODO,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** TODO 6 May 2003 13:52:00 -0000 1.10 --- TODO 12 Jun 2003 11:37:21 -0000 1.11 *************** *** 138,143 **** - undo/redo suports (UndoManager) - - parent/child configurations - - shared EditingContext --- 138,141 ---- *************** *** 198,201 **** --- 196,211 ---- * SQLExpression: + + - check that the special characters '%' and '_' are correctly escaped for + all database + Status: begin. + See: + PostgresqlSQLExpression.sqlPatternFromShellPatternWithEscapeCharacter() + test_EditingContext_Global/test_18_...() + + - also check that special characters in qualifiers ('*', '?') can be + escaped + + - SQLExpression.escapeChar() is declared but has no effect - document the process of generating a select statement (especially for |
From: <sbi...@us...> - 2003-06-12 10:13:26
|
Update of /cvsroot/modeling/ProjectModeling In directory sc8-pr-cvs1:/tmp/cvs-serv23904 Modified Files: DEPENDENCIES Log Message: Added info. for PySQLite Index: DEPENDENCIES =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/DEPENDENCIES,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** DEPENDENCIES 27 May 2003 19:04:45 -0000 1.9 --- DEPENDENCIES 12 Jun 2003 10:13:21 -0000 1.10 *************** *** 41,44 **** --- 41,47 ---- - MySQL-python-0.9.2 [http://sourceforge.net/projects/mysql-python] + * For DatabaseAdaptors.SQLiteAdaptorLayer + + - PySQLite-0.4.3 [http://sqlite.sourceforge.net] * For the QualifierParser (supporting Qualifier.qualifierWithQualifierFormat) |
From: <sbi...@us...> - 2003-06-12 09:35:23
|
Update of /cvsroot/modeling/ProjectModeling/Modeling In directory sc8-pr-cvs1:/tmp/cvs-serv11362 Modified Files: CHANGES DatabaseContext.py Log Message: Fixed bug #753147: fetching twice or more with a given FetchSpecification did not return the same result set (the original FetchSpec was modified) Index: CHANGES =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/Modeling/CHANGES,v retrieving revision 1.108 retrieving revision 1.109 diff -C2 -d -r1.108 -r1.109 *** CHANGES 11 Jun 2003 11:10:11 -0000 1.108 --- CHANGES 12 Jun 2003 09:35:19 -0000 1.109 *************** *** 8,11 **** --- 8,14 ---- -------------------------------------------------------- + * Fixed bug #753147: fetching twice or more with a given FetchSpecification + did not return the same result set (the original FetchSpec was modified) + * New adaptor layer for SQLite Index: DatabaseContext.py =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/Modeling/DatabaseContext.py,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** DatabaseContext.py 11 Jun 2003 11:02:49 -0000 1.15 --- DatabaseContext.py 12 Jun 2003 09:35:19 -0000 1.16 *************** *** 1478,1490 **** objects=[] ! for entityName in entitiesNames: ! aFetchSpec.setEntityName(entityName) ! channel.selectObjectsWithFetchSpecification(aFetchSpec, anEditingContext) ! object=channel.fetchObject() ! while object: ! objects.append(object) ! # object=channel.fetchObject() ! return objects --- 1478,1494 ---- objects=[] ! original_entity_name=aFetchSpec.entityName() ! try: ! for entityName in entitiesNames: ! aFetchSpec.setEntityName(entityName) ! channel.selectObjectsWithFetchSpecification(aFetchSpec, ! anEditingContext) object=channel.fetchObject() ! while object: ! objects.append(object) ! object=channel.fetchObject() ! finally: ! # Fixes bug #753147: aFetchSpec shouldn't be changed ! aFetchSpec.setEntityName(original_entity_name) return objects |
From: <sbi...@us...> - 2003-06-12 09:35:23
|
Update of /cvsroot/modeling/ProjectModeling/Modeling/tests In directory sc8-pr-cvs1:/tmp/cvs-serv11362/tests Modified Files: test_EditingContext_Global_Inheritance.py Log Message: Fixed bug #753147: fetching twice or more with a given FetchSpecification did not return the same result set (the original FetchSpec was modified) Index: test_EditingContext_Global_Inheritance.py =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/Modeling/tests/test_EditingContext_Global_Inheritance.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** test_EditingContext_Global_Inheritance.py 11 Jun 2003 11:10:20 -0000 1.10 --- test_EditingContext_Global_Inheritance.py 12 Jun 2003 09:35:20 -0000 1.11 *************** *** 90,94 **** def test_03_toOneFault_notifications(self): ! "[EditingContext] toOneFault/GlobalIDChangedNotification" ec1=EditingContext() ec2=EditingContext() --- 90,94 ---- def test_03_toOneFault_notifications(self): ! "[EditingContext/Inheritance] toOneFault/GlobalIDChangedNotification" ec1=EditingContext() ec2=EditingContext() *************** *** 145,149 **** def test_04_validation(self): ! "[EditingContext] test Validation" ec=EditingContext() qual=qualifierWithQualifierFormat('street like "2,*"') --- 145,149 ---- def test_04_validation(self): ! "[EditingContext/Inheritance] test Validation" ec=EditingContext() qual=qualifierWithQualifierFormat('street like "2,*"') *************** *** 159,163 **** def test_05_toOneFault_uniquing(self): ! "[EditingContext] Tests that toFaults are also unique within a ec" ec=EditingContext() # get address for John Cleese --- 159,163 ---- def test_05_toOneFault_uniquing(self): ! "[EditingContext/Inheritance] Tests that toFaults are also unique within a ec" ec=EditingContext() # get address for John Cleese *************** *** 182,186 **** def test_05b_toOneFault_uniquing(self): ! "[EditingContext] Tests unicity for toOne-related objects when they are already fetched" ## In this test we make sure that, after an object has been fetched, ## any other object pointing to it do not get a to-one fault, but the --- 182,186 ---- def test_05b_toOneFault_uniquing(self): ! "[EditingContext/Inheritance] Tests unicity for toOne-related objects when they are already fetched" ## In this test we make sure that, after an object has been fetched, ## any other object pointing to it do not get a to-one fault, but the *************** *** 241,245 **** def test_06_objectsCountWithFetchSpecification(self): ! "[EditingContext] objectsCountWithFetchSpecification" ec=EditingContext() fs=FetchSpecification(entityName='Employee') --- 241,245 ---- def test_06_objectsCountWithFetchSpecification(self): ! "[EditingContext/Inheritance] objectsCountWithFetchSpecification" ec=EditingContext() fs=FetchSpecification(entityName='Employee') *************** *** 252,255 **** --- 252,272 ---- self.failIf(nb!=2) + def test_07_fetch_shouldnt_change_FetchSpecification(self): + "[EditingContext/Inheritance] fetching shouldn't change FetchSpecification" + # Bug #753147 + from StoreEmployees import Address + from Modeling.FetchSpecification import FetchSpecification as FS + from Modeling.EditingContext import EditingContext as EC + from Modeling.Qualifier import qualifierWithQualifierFormat as qWQF + + ec = EC() + q = qWQF('toAddresses.zipCode like "4%"') + fs_deep = FS('Employee', qualifier=q, deepFlag=1) # Note the deepFlag + objs1=ec.objectsWithFetchSpecification(fs_deep) + self.failIf(len(objs1)!=3) + self.failIf(fs_deep.entityName()!='Employee') + objs2=ec.objectsWithFetchSpecification(fs_deep) + self.failIf(len(objs2)!=3) + def tearDown(self): """ |
From: <sbi...@us...> - 2003-06-12 00:28:28
|
Update of /cvsroot/modeling/ZModeling/ZModelizationTool/dtml In directory sc8-pr-cvs1:/tmp/cvs-serv1393/ZModelizationTool/dtml Modified Files: model_properties.dtml Log Message: Added SQLite to the list of supported adaptors Index: model_properties.dtml =================================================================== RCS file: /cvsroot/modeling/ZModeling/ZModelizationTool/dtml/model_properties.dtml,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** model_properties.dtml 27 May 2003 19:49:17 -0000 1.9 --- model_properties.dtml 12 Jun 2003 00:28:25 -0000 1.10 *************** *** 22,26 **** <th align="left">adaptorName</th> <td><input type="text" name="adaptorName" value="&dtml-adaptorName;"/></td> ! <td align="left"><font size="-1">Currently supported: Postgresql, MySQL (exact typo!!)</font></td> </tr> <tr> --- 22,26 ---- <th align="left">adaptorName</th> <td><input type="text" name="adaptorName" value="&dtml-adaptorName;"/></td> ! <td align="left"><font size="-1">Currently supported: Postgresql, MySQL, SQLite (exact typo!!)</font></td> </tr> <tr> |
From: <sbi...@us...> - 2003-06-12 00:28:27
|
Update of /cvsroot/modeling/ZModeling In directory sc8-pr-cvs1:/tmp/cvs-serv1393 Modified Files: CHANGES Log Message: Added SQLite to the list of supported adaptors Index: CHANGES =================================================================== RCS file: /cvsroot/modeling/ZModeling/CHANGES,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** CHANGES 27 May 2003 19:49:16 -0000 1.18 --- CHANGES 12 Jun 2003 00:28:24 -0000 1.19 *************** *** 3,6 **** --- 3,8 ---- Current release is: 0.9-pre-8 + * ZModelizationTool: Added SQLite to the list of supported adaptors + 0.9-pre-8 (2003/05/27) --------- |
From: <sbi...@us...> - 2003-06-11 11:36:07
|
Update of /cvsroot/modeling/ProjectModeling/Modeling/doc/HomePage In directory sc8-pr-cvs1:/tmp/cvs-serv1164/doc/HomePage Modified Files: main.tex Log Message: Added info. for SQLite support + link to db-servers home pages Index: main.tex =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/Modeling/doc/HomePage/main.tex,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** main.tex 27 May 2003 20:05:02 -0000 1.15 --- main.tex 11 Jun 2003 11:36:01 -0000 1.16 *************** *** 100,104 **** \begin{description} ! \item[Postgresql] versions 7.2 and 7.3 (see \begin{rawhtml} <a href="http://modeling.sourceforge.net/UserGuide/env-vars-postgresql.html">Postgresql specificities</a>\end{rawhtml} in the User's Guide if you're using v7.3). --- 100,104 ---- \begin{description} ! \item[\begin{rawhtml}<a href="http://www.postgresql.org/">Postgresql</a>\end{rawhtml}] versions 7.2 and 7.3 (see \begin{rawhtml} <a href="http://modeling.sourceforge.net/UserGuide/env-vars-postgresql.html">Postgresql specificities</a>\end{rawhtml} in the User's Guide if you're using v7.3). *************** *** 109,113 **** \end{rawhtml} or \begin{rawhtml} ! <a href="http://www.druid.net/pygresql/">pgdb</a> \end{rawhtml} or \begin{rawhtml} --- 109,113 ---- \end{rawhtml} or \begin{rawhtml} ! <a href="http://www.druid.net/pygresql/">PyGreSQL</a>(pgdb) \end{rawhtml} or \begin{rawhtml} *************** *** 115,124 **** \end{rawhtml} ! \item[MySQL] tested with v3.23.52 ! Supported python adaptor: \begin{rawhtml} <a href="http://sourceforge.net/projects/mysql-python">MySQL</a> \end{rawhtml} \end{description} --- 115,130 ---- \end{rawhtml} ! \item[\begin{rawhtml}<a href="http://www.mysql.com/">MySQL</a>\end{rawhtml}] tested with v3.23.52 Supported python adaptor: \begin{rawhtml} <a href="http://sourceforge.net/projects/mysql-python">MySQL</a> + \end{rawhtml} + + \item[\begin{rawhtml}<a href="http://www.sqlite.org/">SQLite</a>\end{rawhtml}] tested with v2.8.3 + + Supported python adaptor: + \begin{rawhtml} + <a href="http://pysqlite.sourceforge.net/">PySQLite</a> \end{rawhtml} \end{description} |