modeling-users Mailing List for Object-Relational Bridge for python (Page 26)
Status: Abandoned
Brought to you by:
sbigaret
You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(2) |
Sep
(3) |
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(19) |
Feb
(55) |
Mar
(54) |
Apr
(48) |
May
(41) |
Jun
(40) |
Jul
(156) |
Aug
(56) |
Sep
(90) |
Oct
(14) |
Nov
(41) |
Dec
(32) |
2004 |
Jan
(6) |
Feb
(57) |
Mar
(38) |
Apr
(23) |
May
(3) |
Jun
(40) |
Jul
(39) |
Aug
(82) |
Sep
(31) |
Oct
(14) |
Nov
|
Dec
(9) |
2005 |
Jan
|
Feb
(4) |
Mar
(13) |
Apr
|
May
(5) |
Jun
(2) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
(1) |
2006 |
Jan
(1) |
Feb
(1) |
Mar
(9) |
Apr
(1) |
May
|
Jun
(1) |
Jul
(5) |
Aug
|
Sep
(5) |
Oct
(1) |
Nov
|
Dec
|
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
(1) |
Dec
|
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(4) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Sebastien B. <sbi...@us...> - 2003-08-02 08:36:16
|
Hi, > 1. Setting a .cfg, (that sets default adapter to SQLite, and uses the > interpolation feature of ConfigParser to set the data dir), pointing to > it via MDL_DB_CONNECTIONS_CFG, and running a number of > things gives an error, e.g: [...] > File "/usr/lib/python2.2/ConfigParser.py", line 293, in get > raise InterpolationError(key, option, section, rawval) > ConfigParser.InterpolationError: Bad value substitution: > section: [AuthorBooks] > option : database > key : db_data_dir > rawval : %(db_data_dir)s/db_AuthorBooks.db I do not know this interpolation feature, but it seems that you cfg file = is not syntacticly correct. > 2. Creation of an SQLite db via the utility does not work (previosly rep= orted > for pyms) also > for xml models. The command reports no error, but produces no output. (I= t is > of course > trivial to create a db in sqlite, by just doing 'sqlite file', but this = api > should be consistent with > the other adaptors. >=20 > % mdl_generate_DB_schema.py --admin-dsn localhost:StoreEmployees:dummy:d= ummy > -C StoreEmployees/MDL/model_StoreEmployees.xml > % I just noticed that error are swallowed by mdl_generate_DB_schema. Launching it with '-v' will give you the errors, if any (I've corrected it on cvs). > However, it should be noted that running the test scripts, e.g.: > % python ./test_EditingContext_Global.py -r -d SQLite > does create the SQLite db, except that it uses the SQLite.cfg in the tes= ts > dir. Yes, that's intended: tests uses their own settings (the .cfg file in tests/). > But, looking at the test scripts, the code used to create the db is very > different > than the code in the utility script. Could you be more specific? On my side, both test_EC_Global*.py 's reinitDB() and mdl_generate_DB_schema's databaseSchemaWithOptions() iterate on sql expressions returned by the adaptor's SchemaGeneration.schemaCreationStatementsForEntities(). > 3. After creating the db manually, to be able to proceed, generating the > schema does not work, as shown below. In the XML case, no error is > reported, but the db is not been modified at all: >=20 > % mdl_generate_DB_schema.py -R --admin-dsn > localhost:StoreEmployees:dummy:dummy pymodel_StoreEmployees.py > Drop Database FAILED > Reason: >=20 > exceptions.NameError > global name 'cnx' is not defined [...] > File "/usr/lib/python2.2/site-packages/Modeling/DatabaseAdaptors/ > SQLiteAdaptorLayer/SQLiteAdaptor.py", line 85, in > dbAPI_gimmeCnxAndCursorForDBAdmin > cnx.autocommit() [...] I have registered it under bug #781884 https://sf.net/tracker/index.php?func=3Ddetail&aid=3D781884&group_id=3D5893= 5&atid=3D489335 and fixed it. You'll find a patch attached to the bug report, and the fix is also in cvs. Thanks for all you comments and reports, -- S=E9bastien. |
From: Mario R. <ma...@ru...> - 2003-08-02 07:25:01
|
On Samedi, ao=FB 2, 2003, at 02:14, SoaF-BSD wrote: > Something come to my mind since i need to install the modeling > quickly by night .. and i don't use it since a while . There is no > Installation Guide on the Website ? Beside I think i gonna find > a INSTALL.txt somewhere. Good point! There is an INSTALL at top level, and it is old (still mentions PyXML, and does not mention how to run the tests). I guess Dependencies (also old) and Install should be combined into one file, and possibility also exposed as a single web page, separate from the manual. Plus, I find annoying that there is the multitude of files called README, TODO, INSTALL, CHANGES, ... in the distribution tree. This is tricky to keep updated, and rather confusing. Plus, a global HISTORY file, to be able to quickly check back for what change was introduced in which version, is never where I expect to find it (it is CHANGES one level down from top dir in distribution). I think any one of these files should appear in the dist tree strictly only once. mario |
From: SoaF-BSD <so...@la...> - 2003-08-02 00:14:31
|
Something come to my mind since i need to install the modeling quickly by night .. and i don't use it since a while . There is no Installation Guide on the Website ? Beside I think i gonna find a INSTALL.txt somewhere. Bye .Bye .. |
From: Sebastien B. <sbi...@us...> - 2003-08-01 19:02:53
|
Hi Mario, > 1. Changing to adaptorName=3D'SQLite' in the pymodel_StoreEmployees.py, = gives: >=20 > % mdl_validate_model.py -v pymodel_StoreEmployees.py > Loading the model... > Done. > Validating... > Done. > Object: Model StoreEmployees > ---------------------------- > * Warning(s): > - adaptorName 'SQLite' is not one of the framework's, maybe one of y= ours > % >=20 This is really strange. Look at ModelValidation.validateModel_internals(): you can get this when the adaptor's name is not in the declared list of valid adaptor. this means that, somehow, mdl_validate_model.py uses an old version of ModelValidation, v1.6 or lower (SQLite was added in v1.7). Can you check your python path? > 2. When running with SQLite, an admin-connection-dict should not be requ= ired? >=20 > % mdl_generate_DB_schema.py -C pymodel_StoreEmployees.py > Error: option -C requires --admin-connection-dict > % >=20 >=20 > 3. Supplying an admin-dsn: >=20 > % mdl_generate_DB_schema.py --admin-dsn localhost:StoreEmployees:dummy:d= ummy > -C pymodel_StoreEmployees.py > Create Database FAILED > Reason: > exceptions.NameError > global name 'cnx' is not defined > File "/usr/bin/mdl_generate_DB_schema.py", line 85, in > databaseSchemaWithOptions > adaptor.createDatabaseWithAdministrativeConnectionDictionary(admini= strat > iveConnectionDictionary, createUser) > File "/usr/lib/python2.2/site-packages/Modeling/DatabaseAdaptors/ > AbstractDBAPI2AdaptorLayer/AbstractDBAPI2Adaptor.py", line 129, in > createDatabaseWithAdministrativeConnectionDictionary > cnx, > cur=3Dself.dbAPI_gimmeCnxAndCursorForDBAdmin(administrativeConnectionDict= i onary) > File "/usr/lib/python2.2/site-packages/Modeling/DatabaseAdaptors/ > SQLiteAdaptorLayer/SQLiteAdaptor.py", line 85, in > dbAPI_gimmeCnxAndCursorForDBAdmin > cnx.autocommit() Okay, the error is horrible, this should not happen, I'll check this. However, true, I'm not sure the adaptor for SQLite can be able to create a database, I'm not sure this can be easily done w/ pure python (I mean, no os.system()) --but it should raise accordingly, and this should be documented. I'll report when I correct this, thanks for the bug report. -- S=E9bastien. |
From: Mario R. <ma...@ru...> - 2003-08-01 10:43:43
|
1. Setting a .cfg, (that sets default adapter to SQLite, and uses the interpolation feature of ConfigParser to set the data dir), pointing to it via MDL_DB_CONNECTIONS_CFG, and running a number of things gives an error, e.g: % python tests/run.py -h Traceback (most recent call last): File "./run.py", line 38, in ? import test_Attribute File "./test_Attribute.py", line 37, in ? from testPackages.AuthorBooks.Writer import Writer File "./testPackages/AuthorBooks/__init__.py", line 8, in ? model=Model.searchModel('AuthorBooks', mydir, verbose=0) File "/Volumes/Other/modelingcvs/ProjectModeling/Modeling/Model.py", line 234, in searchModel model=loadModel(file) File "/Volumes/Other/modelingcvs/ProjectModeling/Modeling/Model.py", line 204, in loadModel return ModelSet().addModelFromXML({'file': path}) File "/Volumes/Other/modelingcvs/ProjectModeling/Modeling/ModelSet.py", line 196, in addModelFromXML self.addModel(model) File "/Volumes/Other/modelingcvs/ProjectModeling/Modeling/ModelSet.py", line 160, in addModel updateModelWithCFG(aModel, cfg_path) File "/Volumes/Other/modelingcvs/ProjectModeling/Modeling/Model.py", line 112, in updateModelWithCFG defaults[key]=cp.get(model.name(), key) File "/usr/lib/python2.2/ConfigParser.py", line 293, in get raise InterpolationError(key, option, section, rawval) ConfigParser.InterpolationError: Bad value substitution: section: [AuthorBooks] option : database key : db_data_dir rawval : %(db_data_dir)s/db_AuthorBooks.db % 2. Creation of an SQLite db via the utility does not work (previosly reported for pyms) also for xml models. The command reports no error, but produces no output. (It is of course trivial to create a db in sqlite, by just doing 'sqlite file', but this api should be consistent with the other adaptors. % mdl_generate_DB_schema.py --admin-dsn localhost:StoreEmployees:dummy:dummy -C StoreEmployees/MDL/model_StoreEmployees.xml % However, it should be noted that running the test scripts, e.g.: % python ./test_EditingContext_Global.py -r -d SQLite does create the SQLite db, except that it uses the SQLite.cfg in the tests dir. But, looking at the test scripts, the code used to create the db is very different than the code in the utility script. 3. After creating the db manually, to be able to proceed, generating the schema does not work, as shown below. In the XML case, no error is reported, but the db is not been modified at all: % mdl_generate_DB_schema.py -R --admin-dsn localhost:StoreEmployees:dummy:dummy pymodel_StoreEmployees.py Drop Database FAILED Reason: exceptions.NameError global name 'cnx' is not defined File "/usr/bin/mdl_generate_DB_schema.py", line 74, in databaseSchemaWithOptions adaptor.dropDatabaseWithAdministrativeConnectionDictionary(administrativ eConnectionDictionary, dropUser) File "/usr/lib/python2.2/site-packages/Modeling/DatabaseAdaptors/ AbstractDBAPI2AdaptorLayer/AbstractDBAPI2Adaptor.py", line 165, in dropDatabaseWithAdministrativeConnectionDictionary cnx, cur=self.dbAPI_gimmeCnxAndCursorForDBAdmin(administrativeConnectionDicti onary) File "/usr/lib/python2.2/site-packages/Modeling/DatabaseAdaptors/ SQLiteAdaptorLayer/SQLiteAdaptor.py", line 85, in dbAPI_gimmeCnxAndCursorForDBAdmin cnx.autocommit() % mdl_generate_DB_schema.py -R --admin-dsn localhost:StoreEmployees:dummy:dummy StoreEmployees/MDL/model_StoreEmployees.xml % sqlite /Volumes/Other/dev/sqlitedb/data/db_StoreEmployees.db SQLite version 2.8.5 Enter ".help" for instructions sqlite> .schema sqlite> .exit % mario |
From: Mario R. <ma...@ru...> - 2003-08-01 08:39:36
|
hi, 1. Changing to adaptorName='SQLite' in the pymodel_StoreEmployees.py, gives: % mdl_validate_model.py -v pymodel_StoreEmployees.py Loading the model... Done. Validating... Done. Object: Model StoreEmployees ---------------------------- * Warning(s): - adaptorName 'SQLite' is not one of the framework's, maybe one of yours % 2. When running with SQLite, an admin-connection-dict should not be required? % mdl_generate_DB_schema.py -C pymodel_StoreEmployees.py Error: option -C requires --admin-connection-dict % 3. Supplying an admin-dsn: % mdl_generate_DB_schema.py --admin-dsn localhost:StoreEmployees:dummy:dummy -C pymodel_StoreEmployees.py Create Database FAILED Reason: exceptions.NameError global name 'cnx' is not defined File "/usr/bin/mdl_generate_DB_schema.py", line 85, in databaseSchemaWithOptions adaptor.createDatabaseWithAdministrativeConnectionDictionary(administrat iveConnectionDictionary, createUser) File "/usr/lib/python2.2/site-packages/Modeling/DatabaseAdaptors/ AbstractDBAPI2AdaptorLayer/AbstractDBAPI2Adaptor.py", line 129, in createDatabaseWithAdministrativeConnectionDictionary cnx, cur=self.dbAPI_gimmeCnxAndCursorForDBAdmin(administrativeConnectionDicti onary) File "/usr/lib/python2.2/site-packages/Modeling/DatabaseAdaptors/ SQLiteAdaptorLayer/SQLiteAdaptor.py", line 85, in dbAPI_gimmeCnxAndCursorForDBAdmin cnx.autocommit() hgjh % Cheers, mario |
From: Mario R. <ma...@ru...> - 2003-08-01 07:47:40
|
On Jeudi, juil 31, 2003, at 19:11 Europe/Zurich, Sebastien Bigaret wrote: > Mario Ruggier <ma...@ru...> wrote: >> Sorry about my previous message, I had forgotten this old >> SQLite adaptor announcement. > > Not at all, this announcement was made before SQLite was officially > integrated in the framework --as said in a previous post I forgot to > include it in setup.py, hence it was not included in the source > distribution (and the problem with INNER join in the msg you quoted has > been solved in the meantime, before the adaptor layer was integrated to > the framework's core). Ah, very good. But, I was referring (I think) to one of the exceptions from the tests... >> However, I have tried to get >> from CVS but the resulting DatabaseAdaptors/SQLiteAdaptorLayer >> directory is empty. But, viewing with webcvs the files are there... >> Also, sourceforge seems to be consistently getting _really_ slow... > > Yes, sf cvs is getting really slow --this is a known issue, esp. w/ > anonymous pserver, there's doc. on this issue on sf's status page. If > you want, I can put online a snapshot of the CVS, updated daily, that > would probably be handier for those of you who want to access CVS. Thanks, but this should not be necessary (i should not be doing CVS updates so frequently ;) > BTW: if you're trying to 'cvs update' an existing local dir. under cvs > control, you'll need option 'cvs update -Pd' to create and update a new > directory. Thanks... you mean the command should be: cvs -z3 -d:pserver:ano...@cv...:/cvsroot/modeling update -Pd mario |
From: Mario R. <ma...@ru...> - 2003-08-01 07:35:58
|
On Jeudi, juil 31, 2003, at 19:03 Europe/Zurich, Sebastien Bigaret wrote: > Mario Ruggier <ma...@ru...> wrote: >> Just looking into the PyModel implementation, and get the following: >> >> % mdl_validate_model.py pymodel_StoreEmployees.py >> Serious: couldn't load the model >> exceptions.IndentationError >> expected an indented block (line 231) >> File "/usr/bin/mdl_validate_model.py", line 118, in main >> from Modeling import Model >> >> This from a CVS installation today, with the only difference being >> the patch applied above (and with all the tests in test/README >> passing OK, except for teh one noted exception earlier). > > I do not get this error at all and do not see why it happens. I do not > even understand to what "(line 231)" applies to. Any hint on your side? Thanks for the feedback. I have just done a fresh CVS install (and your changes from yesterday all seem to be actually included). There are these probs: First (with no modifications at all): % mdl_validate_model.py -h Traceback (most recent call last): File "/usr/bin/mdl_validate_model.py", line 33, in ? from Modeling.ModelValidation import NOT_SUPPORTED,ERROR,WARNING,INFO,DEBUG ImportError: cannot import name DEBUG Then, if i modify mdl_validate_model.py to not import DEBUG, and change the ignore_levels parameter to its numeric value of 4: % mdl_validate_model.py -v testPackages/StoreEmployees/pymodel_StoreEmployees.py Loading the model... Done. Validating... Traceback (most recent call last): File "/usr/bin/mdl_validate_model.py", line 144, in ? status = main(sys.argv) File "/usr/bin/mdl_validate_model.py", line 128, in main errors=validate_model(model, ignore_levels) File "/usr/bin/mdl_validate_model.py", line 82, in validate_model errors=MV.ModelValidationException(ignore_levels=ignore_levels) File "/usr/lib/python2.2/site-packages/Modeling/ModelValidation.py", line 80, in __init__ raise ValueError, 'Parameter ignored_levels has invalid level(s)' ValueError: Parameter ignored_levels has invalid level(s) Remodifying mdl_validate_model.py, setting ignore_levels to 3: % mdl_validate_model.py -v testPackages/StoreEmployees/pymodel_StoreEmployees.py Loading the model... Done. Validating... Done. No further testing so far, except I have just noticed a little bug in mdl_generate_python_code.py (when using -B): % grep "# Generated by mdl_generate_python_code.py" *.py Address.py:# Generated by mdl_generate_python_code.py / time.strftime("%Y/%m/%d %H:%M") Employee.py:# Generated by mdl_generate_python_code.py / time.strftime("%Y/%m/%d %H:%M") Executive.py:# Generated by mdl_generate_python_code.py / time.strftime("%Y/%m/%d %H:%M") Holidays.py:# Generated by mdl_generate_python_code.py / time.strftime("%Y/%m/%d %H:%M") Mark.py:# Generated by mdl_generate_python_code.py / time.strftime("%Y/%m/%d %H:%M") SalesClerk.py:# Generated by mdl_generate_python_code.py / time.strftime("%Y/%m/%d %H:%M") Store.py:# Generated by mdl_generate_python_code.py / time.strftime("%Y/%m/%d %H:%M") % grep "# Generated by mdl_generate_python_code.py" MDL/*.py MDL/Address.py:# Generated by mdl_generate_python_code.py / 2003/08/01 09:28 MDL/Employee.py:# Generated by mdl_generate_python_code.py / 2003/08/01 09:28 MDL/Executive.py:# Generated by mdl_generate_python_code.py / 2003/08/01 09:28 MDL/Holidays.py:# Generated by mdl_generate_python_code.py / 2003/08/01 09:28 MDL/Mark.py:# Generated by mdl_generate_python_code.py / 2003/08/01 09:28 MDL/SalesClerk.py:# Generated by mdl_generate_python_code.py / 2003/08/01 09:28 MDL/Store.py:# Generated by mdl_generate_python_code.py / 2003/08/01 09:28 Cheers, mario |
From: Sebastien B. <sbi...@us...> - 2003-07-31 17:43:35
|
Mario Ruggier <ma...@ru...> wrote: > Just looking into the PyModel implementation, and get the following: >=20 > % mdl_validate_model.py pymodel_StoreEmployees.py > Serious: couldn't load the model > exceptions.IndentationError > expected an indented block (line 231) > File "/usr/bin/mdl_validate_model.py", line 118, in main > from Modeling import Model >=20 > This from a CVS installation today, with the only difference being > the patch applied above (and with all the tests in test/README > passing OK, except for teh one noted exception earlier). I do not get this error at all and do not see why it happens. I do not even understand to what "(line 231)" applies to. Any hint on your side? > Other quick questions: >=20 > - in the example pymodel_StoreEmployees.py, what is the > component being returned (as in pymodel().component) ? This is described in the doc. string of Model.loadModel(), this is the function that searches for the model. http://modeling.sf.net/API/Modeling-API/public/Modeling.Model-module.html#l= oadModel But it is a little bit out of sync, i'll change it: in fact, when it finds an attribute 'model' in a python module (item 1. in the docstring) it checks whether this is a PyModel or not. > - Why did you opt for requiring a model.build() at the end of a pymodel? > Could this not have been handled automatically from within Model? You're absolutely right, loadModel() can build() it automatically. Enclosed is a patch that enables this --it will be in next version. I also include here a simpler version of pymodel_StoreEmployees.py Thanks for all these comments, that makes things cleaner I think. =20=20 -- S=E9bastien. ------------------------------------------------------------------------ --- Model.py 24 Jul 2003 11:10:53 -0000 1.10 +++ Model.py 31 Jul 2003 16:55:06 -0000 @@ -165,6 +165,7 @@ model=3Dmodel() import PyModel if isinstance(model, PyModel.Model): + model.build() model=3Dmodel.component updateModelWithCFG(model) return model @@ -173,6 +174,7 @@ pymodel=3Dmodule.pymodel if callable(pymodel): pymodel=3Dpymodel() + pymodel.build() updateModelWithCFG(pymodel.component) return pymodel.component ------------------------------------------------------------------------ #! /usr/bin/env python ''' A sample Pythonic OO-RDB Model=20 (re-expressing testPackages/StoreEmployees/model_StoreEmployees.xml) -- A PyModel must define a global variable called 'model', that is of type Mod= el ''' from Modeling.PyModel import * ## # Set preferred defaults for this model (when different from=20 # standard defaults, or if we want to make things explicit) AFloat.defaults['precision'] =3D 10 AFloat.defaults['scale'] =3D 10 AString.defaults['width'] =3D 30 Association.defaults['delete']=3D['nullify', 'nullify'] Entity.defaults['properties'] =3D [ APrimaryKey('id', isClassProperty=3D0, isRequired=3D1, doc=3D'Primary key= !') ] ## _connDict =3D {'database': 'STORE_EMPLOYEES'} model =3D Model('StoreEmployees',adaptorName=3D'Postgresql', connDict=3D_connDict) model.doc =3D ' ... ' model.version=3D'0.1' model.entities =3D [ # Entity('Store', properties=3D[ AString('corporateName', isRequired=3D1), ], ), Entity('Employee', properties=3D[ AString('lastName',isRequired=3D1,usedForLocking=3D= 1, width=3D20), AString('firstName', isRequired=3D1, width=3D50, usedForLocking=3D1), ] ), Entity('SalesClerk', parent=3D'Employee', properties=3D[ AString('storeArea', width=3D20) ] ), Entity('Executive', parent=3D'Employee', properties=3D[ AString('officeLocation', width=3D5) ] ), Entity('Address', properties=3D[ AString('street', width=3D80),=20 AString('zipCode', width=3D10),=20 AString('town'), ] ), Entity('Mark', properties=3D[ AInteger('month', isRequired=3D1),=20 AInteger('mark', isRequired=3D1), ] ), Entity('Holidays', properties=3D[ ADateTime('startDate', isRequired=3D1),=20 ADateTime('endDate', isRequired=3D1), ] ), ] model.associations=3D[ Association('Mark', 'Executive', relations=3D['executive', 'marks'], delete=3D['nullify', 'cascade'], keys=3D['FK_Executive_id', 'id']), Association('Address', 'Employee', relations=3D['toEmployee', 'toAddresses'], delete=3D['deny', 'cascade'], keys=3D['fkEmployeeId', 'id'], ), Association('Employee', 'Store', relations=3D['toStore', 'employees'], delete=3D['nullify', 'deny'], keys=3D['fkStoreId', 'id']), Association('Holidays', 'Employee', relations=3D[None, 'holidays'], delete=3D[None, 'cascade'], keys=3D['fkEmployeeId', 'id']), ] |
From: Sebastien B. <sbi...@us...> - 2003-07-31 17:23:07
|
Mario Ruggier <ma...@ru...> wrote: > Sorry about my previous message, I had forgotten this old > SQLite adaptor announcement. Not at all, this announcement was made before SQLite was officially integrated in the framework --as said in a previous post I forgot to include it in setup.py, hence it was not included in the source distribution (and the problem with INNER join in the msg you quoted has been solved in the meantime, before the adaptor layer was integrated to the framework's core). > However, I have tried to get > from CVS but the resulting DatabaseAdaptors/SQLiteAdaptorLayer > directory is empty. But, viewing with webcvs the files are there... > Also, sourceforge seems to be consistently getting _really_ slow... Yes, sf cvs is getting really slow --this is a known issue, esp. w/ anonymous pserver, there's doc. on this issue on sf's status page. If you want, I can put online a snapshot of the CVS, updated daily, that would probably be handier for those of you who want to access CVS. BTW: if you're trying to 'cvs update' an existing local dir. under cvs control, you'll need option 'cvs update -Pd' to create and update a new directory. Cheers, -- S=E9bastien. |
From: Sebastien B. <sbi...@us...> - 2003-07-31 16:56:50
|
Mario Ruggier <ma...@ru...> wrote: > OK. I touched up that README file to reflect these changes, > and it is attached. (Also, simplified the formatting for easier > copy'n'paste.) Thanks a lot, I'll add this to cvs. > I noticed there is no sample .cfg for SQLite, and running the tests for > this fails: I forgot to include it in MANIFEST.in, sorry. > Hmmn, the DatabaseAdaptors/SQLiteAdaptorLayer package is not > included in the distribution? Oh well... The package was not added to setup.py. Thanks for noticing, I fixed that on cvs. -- S=E9bastien. |
From: Mario R. <ma...@ru...> - 2003-07-31 15:31:43
|
On Jeudi, juil 31, 2003, at 13:21 Europe/Zurich, Mario Ruggier wrote: >>> % python test_AdaptorLayer.py >>> Traceback (most recent call last): >>> File "test_AdaptorLayer.py", line 36, in ? >>> from utils import parseConfigFile_and_updateModel >>> ImportError: cannot import name parseConfigFile_and_updateModel >>> % >> >> I forgot that one, sorry, so it was not updated when this function was >> transferred to Model.updateModelWithCFG(). You'll find enclosed a >> patch >> correcting this, I'll update it on cvs. Thanks for reporting. > > Applied the patch, and works OK. Just looking into the PyModel implementation, and get the following: % mdl_validate_model.py pymodel_StoreEmployees.py Serious: couldn't load the model exceptions.IndentationError expected an indented block (line 231) File "/usr/bin/mdl_validate_model.py", line 118, in main from Modeling import Model This from a CVS installation today, with the only difference being the patch applied above (and with all the tests in test/README passing OK, except for teh one noted exception earlier). Other quick questions: - in the example pymodel_StoreEmployees.py, what is the component being returned (as in pymodel().component) ? - Why did you opt for requiring a model.build() at the end of a pymodel? Could this not have been handled automatically from within Model? mario |
From: <Lot...@ne...> - 2003-07-31 14:58:15
|
FROM: THE DESK OF THE DIRECTOR PROMOTIONS, INTERNATIONAL PROMOTIONS/PRIZE AWARD DEPARTMENT, REF: WBL/67-AO91657984 ATTENTION: AWARD NOTIFICATION; FINAL NOTICE We are pleased to inform you of the announcement today, 31th of July, 2003 of winners of the WERKEN BIJ DE LOTTO INTERNATIONAL PROGRAMS held on 25th of July, 2003. INTERNATIONAL PROGRAMS held on 25th of July, 2003. Your email address, attached to ticket number 013-2316-2002-477, with serial Numbers: A025-09 drew the lucky numbers: 37-13-34-85-56-42, and consequently won in category C. You have therefore been approved for a lump sum pay of US$215,000.00 in cash credited to file REF NO. REF: WBL/67-AO91657984. This is from total prize money of US$22,500,000.00 shared among the fifteen international winners in the category C. All participants were selected through a computer ballot system drawn from 70,000 names from Australia, New Zealand, America, Asia, Europe and North America as part our International Promotions Program, which is conducted annually. conducted annually. CONGRATULATIONS! Your fund is now deposited with a Financial and Security House insured in your name. Due to the mix up of some numbers and names, we ask that you keep this award strictly from public notice until your claim has been processed and your money remitted to your account. This is part of our security protocol to avoid double claiming or unscrupulous acts by participants of this program. Participants of this program. We hope with a part of you prize, you will participate in our end of year high stakes US$1.3 billion International lotto To begin your claim, please contact your claims officer immediately with your Full name, Telephone and Fax number. PARKSON JOHN (OPERATIONS) EMAIL: con...@co... For due processing and remittance of your prize money to a designated account of your choice. Remember, you must contact your claims officer not later than 10th august 2003. After this date, all funds will be returned as unclaimed. NOTE: In order to avoid unnecessary delays and complications, please remember to quote your reference number in every one of your correspondences with your officer. Furthermore, should there be any change of your address, do inform your claims officer as soon as possible. Congratulations again from all our staff and thank you for being part of our promotions program. Sincerely, THE DIRECTOR PROMOTIONS, WERKEN BIJ DE LOTTO www.werken-bij-delotto.net N.B Any breach of confidentiality on the part of the winners will result to disqualification. |
From: Mario R. <ma...@ru...> - 2003-07-31 13:00:18
|
Sorry about my previous message, I had forgotten this old SQLite adaptor announcement. However, I have tried to get from CVS but the resulting DatabaseAdaptors/SQLiteAdaptorLayer directory is empty. But, viewing with webcvs the files are there... Also, sourceforge seems to be consistently getting _really_ slow... mario > Hi all, > > I've just quickly made an adaptor for SQLite based on pysqlite. If > somebody here is interested in testing it please tell I'll make the > patch against 0.9pre8 available. > > I still have a little problem with it (cannot find a way to handle a > nested INNER JOIN --syntax error / help request sent on the sqlite > mailing-list), however it might be already of some interest to one of > you. BTW if you have some experience w/ SQLite I'd be happy to hear=20 > from > you! > > -- S=E9bastien. > > SQLite: http://www.hwaci.com/sw/sqlite/ > pysqlite: http://pysqlite.sourceforge.net/ |
From: Mario R. <ma...@ru...> - 2003-07-31 12:12:25
|
Hmmn, the DatabaseAdaptors/SQLiteAdaptorLayer package is not included in the distribution? mario On Jeudi, juil 31, 2003, at 13:21 Europe/Zurich, Mario Ruggier wrote: > I noticed there is no sample .cfg for SQLite, and running the tests for > this fails: > > % python test_EditingContext_Global.py -r -d SQLite > Traceback (most recent call last): > File "test_EditingContext_Global.py", line 1297, in ? > errs = main(sys.argv) > File "test_EditingContext_Global.py", line 1273, in main > Model.updateModelWithCFG(author_books_model, database_cfg) > File > "/Volumes/Other/modelingcvs/release/ModelingCore-0.9-pre-11/Modeling/ > Model.py", line 105, in updateModelWithCFG > raise IOError, err_msg > IOError: Unable to open file 'SQLite.cfg' (passed in parameter > 'cfg_path' or taken from env. variable MDL_DB_CONNECTIONS_CFG > Original exception was: IOError: [Errno 2] No such file or directory: > 'SQLite.cfg' > % |
From: Sebastien B. <sbi...@us...> - 2003-07-31 11:30:08
|
Jer...@fi... wrote: [About SELECT DISTINCT] > I'm thinking that you really need to check this carefully since sometimes > we don't want to use disctinct, no ? hum deleting or count may have the > same trouble no ?=20 >=20 > I haven't work w/ modeling since 5 months right now so I may say wrong=20 > things .. pay caution No, you're right as far as ec.fetchCount() is concerned: it is also affected by this bug. Alas, I've no patch to propose for fetchCount() yet: I can't find a portable way of making this (see below). Deletes, inserts or updates are not affected by this bug, because the framework never joins tables for these operations. About fetch(): I can't think of any situations where you would not want the DISTINCT stuff. If you can think of such situations, I think it's time to speak ;) However, I'm still not sure that the DISTINCT keyword will always be added to any select statements, it can be better to add it only when tables are joined. Now back on fetchCount(): I've found these two forms: Form #1 ------- SELECT count(DISTINCT(t0.id)) [as count] FROM WRITER t0 INNER JOIN BOOK t1 ON t0.ID=3Dt1.FK_WRITER_ID WHERE ((t0.AGE < 100 OR t0.AGE > 200) AND t1.title LIKE '%'); Form #2 ------- SELECT count(*) from ( SELECT DISTINCT t0.ID,t0.FIRST_NAME,t0.LAST_NAME,t0.AGE,t0.BIRTHDAY,t0.FK_W= RITER_ID FROM WRITER t0 INNER JOIN BOOK t1 ON t0.ID=3Dt1.FK_WRITER_ID WHERE ((t0.AGE < 100 OR t0.AGE > 200) AND t1.title LIKE '%')) And here is how db-server accepts them: |Postgres| MySQL | SQLite | O9i | O8i | ---+--------+-------+--------+-----+-----| #1 | Y | Y | N | Y | Y | ---+--------+-------+--------+-----+-----| #2 | Y[1] | N | Y | Y | Y | ---+--------+-------+--------+-----+-----+ [1] for postgresql, 'as foo' should be appended at the end of the SQL statement Form #1 is clearly an extension of ANSI SQL-92, but I can't find whether form #2 is SQL-92 or not; I suspect it is, and that a from statement can be a sub-query (the so-called table subqueries), but I'd like to hear from you if you're sure about it. I think I'll probably make #2 the default in SQLExpression, and use #1 for MySQL. -- S=E9bastien. |
From: Mario R. <ma...@ru...> - 2003-07-31 11:21:42
|
On Mercredi, juil 30, 2003, at 19:14 Europe/Zurich, Sebastien Bigaret =20= wrote: > Mario Ruggier <ma...@ru...> wrote: ... >> % python test_EditingContext_Global.py >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> FAIL: [EC] Checks that a FK/class prop. gets its value after saving =20= >> changes ... > Okay, this one is expected --and will assert differently in the next FIne, thanks. >> % python test_AdaptorLayer.py >> Traceback (most recent call last): >> File "test_AdaptorLayer.py", line 36, in ? >> from utils import parseConfigFile_and_updateModel >> ImportError: cannot import name parseConfigFile_and_updateModel >> % > > I forgot that one, sorry, so it was not updated when this function was > transferred to Model.updateModelWithCFG(). You'll find enclosed a = patch > correcting this, I'll update it on cvs. Thanks for reporting. Applied the patch, and works OK. >> I should worry about this? >> Also, there are other test steps to execute now? >> (i.e. should this README be update?) > > I've re-read it and yes, you're right, it should be updated: > > - test_EditingContext_ParentChild.py is not mentioned (tests for > nested ECs) > > - it should also mention that the three test_EditingContext_*.py > testsuites take option '-d' to specify the database: '-d =20 > Postgresql' > (default), '-d MySQL', '-d SQLite'. Each one corresponds to its > dedicated configuration file: Postgresql.cfg, etc. OK. I touched up that README file to reflect these changes, and it is attached. (Also, simplified the formatting for easier =20 copy'n'paste.) I noticed there is no sample .cfg for SQLite, and running the tests for this fails: % python test_EditingContext_Global.py -r -d SQLite Traceback (most recent call last): File "test_EditingContext_Global.py", line 1297, in ? errs =3D main(sys.argv) File "test_EditingContext_Global.py", line 1273, in main Model.updateModelWithCFG(author_books_model, database_cfg) File =20 "/Volumes/Other/modelingcvs/release/ModelingCore-0.9-pre-11/Modeling/=20 Model.py", line 105, in updateModelWithCFG raise IOError, err_msg IOError: Unable to open file 'SQLite.cfg' (passed in parameter =20 'cfg_path' or taken from env. variable MDL_DB_CONNECTIONS_CFG Original exception was: IOError: [Errno 2] No such file or directory: =20= 'SQLite.cfg' % Cheers, mario > -- S=E9bastien. |
From: <Jer...@fi...> - 2003-07-31 00:14:29
|
On Wednesday 30 July 2003 22:50, Sebastien Bigaret wrote: > So J=E9r=F4me was right and what we have here is not a mysql bug at all > --it's the way SQL behaves: all JOIN results in a cartesian product so > we can get duplicates. I don't know how many times I've forgotten that, > but I bet it's not the last one :/ For details, see for example: > http://developer.postgresql.org/docs/postgres/sql-select.html > > =3D> the bug is in the SQL generated by the framework itself. It makes it > possible to get duplicates in the result set returned by > EditingContext.fetch(). > > You'll find attached a simple patch solving the problem. I won't have > the time to make a new release this evening, and probably not before > the week-end. I plan to do it not latter than sunday evening. > > Regards, > > -- S=E9bastien. > > > ------------------------------------------------------------------------ > --- SQLExpression.py 24 Jul 2003 12:07:25 -0000 1.19 > +++ SQLExpression.py 30 Jul 2003 20:36:34 -0000 > @@ -491,7 +491,7 @@ > lockClause): > """ > """ > - statement=3DselectString or 'SELECT ' > + statement=3DselectString or 'SELECT DISTINCT ' > statement+=3DcolumnList > statement+=3D' FROM '+tableList > if lockClause: > ------------------------------------------------------------------------ I'm thinking that you really need to check this carefully since sometimes we don't want to use disctinct, no ? hum deleting or count may have the same trouble no ?=20 I haven't work w/ modeling since 5 months right now so I may say wrong=20 things .. pay caution Bye Bye |
From: Sebastien B. <sbi...@us...> - 2003-07-30 21:04:10
|
To all: what Yannick revealed with this is a bug that impacts ALL ------ adaptors: Postgresql, MySQL, SQLite and Oracle. Summary: ec.fetch() can return duplicates in its result set. At the end of the message there's a patch that fixes the problem, until a new release is made. Yannick Gingras <yan...@sa...> writes: > > NB: it seems to me that these requests corresponds to/are variant of > > your original query returning duplicates, which was: > > > > SELECT t0.activity_id, t0.code, t0.enterprise_id, t0.is_active > > FROM ABCI18N t1 INNER JOIN ABC t0 ON ( t0.activity_id=3Dt1.activity_i= d ) > > WHERE (t0.code LIKE '%%' AND t0.is_active <> -255 AND t1.title LIKE > > '%ABC%') >=20 > What may be different is that I have 2 records in ABCI18N that in fact al= l=20 > matcch "%ABC%" :=20 > mysql> select * from ABCI18N where title like "%ABC%"; > +----+-------------+---------+-------------------------------------------= +-----------------------------------+ > | id | activity_id | lang_id | description = |=20 > title | > +----+-------------+---------+-------------------------------------------= +-----------------------------------+ > | 3 | 2 | 1 | Description de l'activit=C3=A9 num=C3=A9ro= ABC123 |=20 > Titre de l'activit=C3=A9 ABC123 | > | 4 | 2 | 2 | Description of the activity code ABC123 = |=20 > Title of the activity code ABC123 | > +----+-------------+---------+-------------------------------------------= +-----------------------------------+ >=20 > So this may explain why the select match twice here and not on you databa= se. Thanks *a lot* for reporting this and giving the details. It reveals a real bug in the framework. In fact I was not careful enough when writing my test queries. The following query is the equivalent one, this time: SELECT t0.ID,t0.FIRST_NAME,t0.LAST_NAME,t0.AGE,t0.BIRTHDAY,t0.FK_WRITER_ID FROM WRITER t0 INNER JOIN BOOK t1 ON t0.ID=3Dt1.FK_WRITER_ID WHERE ((t0.AGE < 100 OR t0.AGE > 200) AND t1.title LIKE '%'); and it returns duplicates as well, for the data inserted when initializing the test db (no insert needed): id | first_name | last_name | age | birthday | fk_writer_id=20 ----+------------+-----------+-----+---------------------+-------------- 2 | Francois | Rabelais | 508 | 1484-07-02 18:16:12 |=20=20=20=20=20= =20=20=20=20=20=20=20=20 3 | Frederic | Dard | 81 | 1921-06-29 04:56:34 | 2 3 | Frederic | Dard | 81 | 1921-06-29 04:56:34 | 2 3 | Frederic | Dard | 81 | 1921-06-29 04:56:34 | 2 So J=E9r=F4me was right and what we have here is not a mysql bug at all --it's the way SQL behaves: all JOIN results in a cartesian product so we can get duplicates. I don't know how many times I've forgotten that, but I bet it's not the last one :/ For details, see for example: http://developer.postgresql.org/docs/postgres/sql-select.html =3D> the bug is in the SQL generated by the framework itself. It makes it possible to get duplicates in the result set returned by EditingContext.fetch(). You'll find attached a simple patch solving the problem. I won't have the time to make a new release this evening, and probably not before the week-end. I plan to do it not latter than sunday evening. Regards, -- S=E9bastien. ------------------------------------------------------------------------ --- SQLExpression.py 24 Jul 2003 12:07:25 -0000 1.19 +++ SQLExpression.py 30 Jul 2003 20:36:34 -0000 @@ -491,7 +491,7 @@ lockClause): """ """ - statement=3DselectString or 'SELECT ' + statement=3DselectString or 'SELECT DISTINCT ' statement+=3DcolumnList statement+=3D' FROM '+tableList if lockClause: ------------------------------------------------------------------------ |
From: Yannick G. <yan...@sa...> - 2003-07-30 19:05:55
|
=2D----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On July 30, 2003 01:45 pm, Sebastien Bigaret wrote: > Yes, I'm no sql guru, but I know such things can happen and that's why > I'd like to make sure. If I could reproduce it on my msql 4.0 I'll > conclude the same --but maybe I'm not trying the right thing. > > > Yannick, could you please perform the following: > > - create, if it's not already done, the AUTHOR_BOOKS test database > e.g.: [mysqladmin -h localhost -u root create "AUTHORBOOKS"] > =20 > - change the current directory to Modeling/tests and run python > ./test_EditingContext_Global.py -d MySQL -r (you'll get errors for > DROP TABLE --this is okay) Works perfectly > - at the mysql prompt for db AUTHOR_BOOKS copy-paste the following: > [sniped] > Do you see any duplicates?? No dupes > NB: it seems to me that these requests corresponds to/are variant of > your original query returning duplicates, which was: > > SELECT t0.activity_id, t0.code, t0.enterprise_id, t0.is_active > FROM ABCI18N t1 INNER JOIN ABC t0 ON ( t0.activity_id=3Dt1.activity_id ) > WHERE (t0.code LIKE '%%' AND t0.is_active <> -255 AND t1.title LIKE > '%ABC%') What may be different is that I have 2 records in ABCI18N that in fact all= =20 matcch "%ABC%" :=20 mysql> select * from ABCI18N where title like "%ABC%"; +----+-------------+---------+-------------------------------------------+-= =2D---------------------------------+ | id | activity_id | lang_id | description |= =20 title | +----+-------------+---------+-------------------------------------------+-= =2D---------------------------------+ | 3 | 2 | 1 | Description de l'activit=C3=A9 num=C3=A9ro A= BC123 |=20 Titre de l'activit=C3=A9 ABC123 | | 4 | 2 | 2 | Description of the activity code ABC123 |= =20 Title of the activity code ABC123 | +----+-------------+---------+-------------------------------------------+-= =2D---------------------------------+ So this may explain why the select match twice here and not on you database. =2D --=20 Yannick Gingras Byte Gardener, Savoir-faire Linux inc. http://www.savoirfairelinux.com/ =2D----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE/KBVQrhy5Fqn/MRARAiWiAKCRV+l9eVtgV5mUUcudiZAHg4S3dgCcDTbY fKgJCsjlk1AHESpmKAhprts=3D =3DRXii =2D----END PGP SIGNATURE----- |
From: Sebastien B. <sbi...@us...> - 2003-07-30 17:44:53
|
Jer...@fi... wrote: > Hum i'm quite sure that it isn't a MySQL bug .. but a SQL one .=20 > This kind of 'too much result' usually occur while using a wrong > 'LEFT OUTER JOIN' or 'GROUP' directive . Pay caution that=20 >=20 > select * from t1 left outer join t2 on t1.ID =3D=3D t2.FK_t1 is different= =20 > from=20 > select * from t2 left outer join t1 on t1.ID =3D=3D t2.FK_t1.=20 > Even thought you will get the same kind of result.=20 Yes, I'm no sql guru, but I know such things can happen and that's why I'd like to make sure. If I could reproduce it on my msql 4.0 I'll conclude the same --but maybe I'm not trying the right thing. Yannick, could you please perform the following: - create, if it's not already done, the AUTHOR_BOOKS test database e.g.: [mysqladmin -h localhost -u root create "AUTHORBOOKS"] =20=20 - change the current directory to Modeling/tests and run python ./test_EditingContext_Global.py -d MySQL -r (you'll get errors for DROP TABLE --this is okay) =20=20 - at the mysql prompt for db AUTHOR_BOOKS copy-paste the following: INSERT INTO PK_SEQ_WRITER VALUES (18); INSERT INTO PK_SEQ_BOOK VALUES (20); INSERT INTO BOOK VALUES (NULL,'t3',20,18); INSERT INTO BOOK VALUES (NULL,'t2',19,18); INSERT INTO BOOK VALUES (NULL,'t1',18,18); INSERT INTO WRITER VALUES ('','w test1',NULL,0,NULL,18); Now, try these three select statements: select t0.id, t0.title, t0.price from WRITER t1 INNER JOIN BOOK t0 ON (t0.fk_writer_id=3Dt1.id) where (t0.title like '%' AND t0.price <> 0 AND t1.last_name like '%'); and: select t0.id, t0.title, t0.price=20 from BOOK t0=20 INNER JOIN WRITER t1 ON (t0.fk_writer_id=3Dt1.id) where (t0.title like '%' AND t0.id <> 0 AND t1.last_name like '%'); and: select t0.id, t0.title, t0.price=20 from BOOK t0=20 INNER JOIN WRITER t1 ON (t1.id=3Dt0.fk_writer_id) where (t0.title like '%' AND t0.price <> 0 AND t1.last_name like '%'); Do you see any duplicates?? NB: it seems to me that these requests corresponds to/are variant of your original query returning duplicates, which was: SELECT t0.activity_id, t0.code, t0.enterprise_id, t0.is_active=20 FROM ABCI18N t1 INNER JOIN ABC t0 ON ( t0.activity_id=3Dt1.activity_id ) WHERE (t0.code LIKE '%%' AND t0.is_active <> -255 AND t1.title LIKE '%ABC= %') -- S=E9bastien. |
From: Sebastien B. <sbi...@us...> - 2003-07-30 17:14:04
|
Hi, Mario Ruggier <ma...@ru...> wrote: > Hi, >=20 > remember the tests/README file? I just followed that sequence, > and, get this for these two steps: >=20 > ... >=20 > % python test_EditingContext_Global.py > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > FAIL: [EC] Checks that a FK/class prop. gets its value after saving chang= es > ---------------------------------------------------------------------- > Traceback (most recent call last): > File "test_EditingContext_Global.py", line 922, in > test_17b_insertedObject_and_FK_as_classProperty [snipped] Okay, this one is expected --and will assert differently in the next release. It was there to remind me to examine bug #775082 https://sf.net/tracker/index.php?func=3Ddetail&aid=3D775082&group_id=3D5893= 5&atid=3D489335 which is now marked as "won't fix". Full details have been added to the documentation and will be released w/ the next version. If you need informations in the mean time, you'll find it there: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/modeling/ProjectModeling/Mod= eling/doc/UserGuide/FAQ.tex?rev=3D1.3&content-type=3Dtext/vnd.viewcvs-markup Faq entry: "What if I want to see the foreign key values in my objects?" > % python test_AdaptorLayer.py > Traceback (most recent call last): > File "test_AdaptorLayer.py", line 36, in ? > from utils import parseConfigFile_and_updateModel > ImportError: cannot import name parseConfigFile_and_updateModel > % I forgot that one, sorry, so it was not updated when this function was transferred to Model.updateModelWithCFG(). You'll find enclosed a patch correcting this, I'll update it on cvs. Thanks for reporting. >=20 > I should worry about this? > Also, there are other test steps to execute now? > (i.e. should this README be update?) I've re-read it and yes, you're right, it should be updated: - test_EditingContext_ParentChild.py is not mentioned (tests for nested ECs) - it should also mention that the three test_EditingContext_*.py testsuites take option '-d' to specify the database: '-d Postgresql' (default), '-d MySQL', '-d SQLite'. Each one corresponds to its dedicated configuration file: Postgresql.cfg, etc. -- S=E9bastien. ------------------------------------------------------------------------ --- test_AdaptorLayer.py 20 Feb 2003 15:12:47 -0000 1.1 +++ test_AdaptorLayer.py 30 Jul 2003 17:01:42 -0000 @@ -33,11 +33,10 @@ =20 import unittest, sys import utils -from utils import parseConfigFile_and_updateModel if __name__ =3D=3D "__main__": utils.fixpath() =20 -from Modeling import ModelSet +from Modeling import ModelSet, Model from Modeling.EditingContext import EditingContext from Modeling.FetchSpecification import FetchSpecification from Modeling.Qualifier import qualifierWithQualifierFormat @@ -134,13 +133,13 @@ =20 =20 verbose=3D0 -databaseAdaptorName=3D'Postgresql' +database_cfg=3D'Postgresql.cfg' =20 def main(args): me=3Dargs[0] import getopt options, args =3D getopt.getopt(sys.argv[1:], 'vVpd:') - global verbose, databaseAdaptorName + global verbose, database_cfg =20 profile=3D0 for k, v in options: @@ -150,16 +149,16 @@ if k=3D=3D'-p': profile=3D1; continue if k=3D=3D'-d': if v not in ('Postgresql', 'MySQL'): usage(me); return 1 - databaseAdaptorName=3Dv + database_cfg=3D'%s.cfg'%v continue =20 if args: usage(me); return 1 =20 author_books_model=3DModelSet.defaultModelSet().modelNamed('AuthorBooks') - parseConfigFile_and_updateModel(author_books_model, databaseAdaptorName) + Model.updateModelWithCFG(author_books_model, database_cfg) =20 # MySQL specifics: change TIMESTAMP to DATETIME - if databaseAdaptorName=3D=3D'MySQL': + if database_cfg=3D=3D'MySQL.cfg': author_books_model.entityNamed('Writer').attributeNamed('birthday').se= tExternalType('DATETIME') =20 if profile: ------------------------------------------------------------------------ |
From: <Jer...@fi...> - 2003-07-30 16:27:27
|
On Wednesday 30 July 2003 16:52, Sebastien Bigaret wrote: > Hi, > > Good to know this fixed your problem. May I ask you to be a little > more explicit about the version of mysql you use? --possibly off-list, > if for any reasons you don't want to expose it publicly. > > I'm asking this because I'm trying to know whether this should be > included in the core, or if I just need to add a warning (along w/ the > patch) for versions<x.y.z in the User's Guide (I cannot possibly have > all versions of mysql installed here to test ;). Moreover, I would > like to ask you to try some sample sql statements on your db, if > possible, against the tests databases (author_books and > store_employees). > > Thanks in advance, > > - S=E9bastien. > Hum i'm quite sure that it isn't a MySQL bug .. but a SQL one .=20 This kind of 'too much result' usually occur while using a wrong 'LEFT OUTER JOIN' or 'GROUP' directive . Pay caution that=20 select * from t1 left outer join t2 on t1.ID =3D=3D t2.FK_t1 is different=20 from=20 select * from t2 left outer join t1 on t1.ID =3D=3D t2.FK_t1.=20 Even thought you will get the same kind of result.=20 Bye bye ..=20 |
From: Mario R. <ma...@ru...> - 2003-07-30 16:22:07
|
Hi, remember the tests/README file? I just followed that sequence, and, get this for these two steps: ... % python test_EditingContext_Global.py ====================================================================== FAIL: [EC] Checks that a FK/class prop. gets its value after saving changes ---------------------------------------------------------------------- Traceback (most recent call last): File "test_EditingContext_Global.py", line 922, in test_17b_insertedObject_and_FK_as_classProperty self.assertEqual(b.getFK_Writer_Id(), gid.keyValues()['id']) File "/BinaryCache/python/python-3.root~193/usr/lib/python2.2/unittest.py", line 286, in failUnlessEqual raise self.failureException, \ AssertionError: None != 19 ---------------------------------------------------------------------- Ran 33 tests in 30.675s FAILED (failures=1) 'Errors' indicate exceptions other than AssertionError. 'Failures' indicate AssertionError 0 errors, 1 failures % ... % python test_AdaptorLayer.py Traceback (most recent call last): File "test_AdaptorLayer.py", line 36, in ? from utils import parseConfigFile_and_updateModel ImportError: cannot import name parseConfigFile_and_updateModel % I should worry about this? Also, there are other test steps to execute now? (i.e. should this README be update?) mario |
From: Yannick G. <yan...@sa...> - 2003-07-30 16:18:09
|
=2D----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On July 30, 2003 10:52 am, Sebastien Bigaret wrote: > Good to know this fixed your problem. May I ask you to be a little > more explicit about the version of mysql you use? --possibly off-list, > if for any reasons you don't want to expose it publicly. # rpm -qa | grep mysql mysql-devel-3.23.56-1.80 php-mysql-4.2.2-8.0.7 mysql-server-3.23.56-1.80 mysql-3.23.56-1.80 It's a stock Red Hat 8.0 > I'm asking this because I'm trying to know whether this should be > included in the core, or if I just need to add a warning (along w/ the > patch) for versions<x.y.z in the User's Guide (I cannot possibly have > all versions of mysql installed here to test ;). Moreover, I would > like to ask you to try some sample sql statements on your db, if > possible, against the tests databases (author_books and > store_employees). Sure, no problem. =2D --=20 Yannick Gingras Byte Gardener, Savoir-faire Linux inc. http://www.savoirfairelinux.com/ =2D----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE/J+FBrhy5Fqn/MRARAmeNAJsEQf58Ibj0cWsEw/4n5d8OYUJQ/gCfUS3Y OIAsjHmTcv6SncbOQWAbJ04=3D =3DPbqQ =2D----END PGP SIGNATURE----- |