modeling-cvs Mailing List for Object-Relational Bridge for python (Page 10)
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-12-15 15:15:49
|
Update of /cvsroot/modeling/ProjectModeling In directory sc8-pr-cvs1:/tmp/cvs-serv13480 Modified Files: CHANGES Log Message: Fixed bug #847212: qualifier IN does not handle correctly strings (strings were not quoted as they should be) Index: CHANGES =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/CHANGES,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** CHANGES 15 Dec 2003 15:05:00 -0000 1.27 --- CHANGES 15 Dec 2003 15:15:46 -0000 1.28 *************** *** 10,13 **** --- 10,16 ---- * Fixed bug #857803: mysql: invalid generated sql for complex qualifiers + * Fixed bug #847212: qualifier IN does not handle correctly strings (strings + were not quoted as they should be) + * Fixed bug #854630: an empty qualifier string made ec.fetch() fail |
From: <sbi...@us...> - 2003-12-15 15:05:03
|
Update of /cvsroot/modeling/ProjectModeling/Modeling/DatabaseAdaptors/OracleAdaptorLayer In directory sc8-pr-cvs1:/tmp/cvs-serv10442/Modeling/DatabaseAdaptors/OracleAdaptorLayer Modified Files: OracleSQLExpression.py Log Message: Fixed bug #857803: mysql: invalid generated sql for complex qualifiers Index: OracleSQLExpression.py =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/Modeling/DatabaseAdaptors/OracleAdaptorLayer/OracleSQLExpression.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** OracleSQLExpression.py 31 Aug 2003 15:02:51 -0000 1.2 --- OracleSQLExpression.py 15 Dec 2003 15:05:00 -0000 1.3 *************** *** 51,106 **** """ - def _addTableJoinsForAlias(self, alias, str): - """ - Changes the default way the Modeling.SQLExpression calculates SQL - statements for JOIN. - - It depends on the version of Oracle used there. - - For Oracle 8i, we return the ANSI equivalent of 'INNER JOIN', which o8i - does not support. - - For Oracle 9i, we return the default, as built by Modeling.SQLExpression:: - - table0 alias0 INNER JOIN [ (some other nested join) | table1 alias1 ] - ON (join condition) - - """ - if oracle_server_version()=='9i': - return SQLExpression._addTableJoinsForAlias(self, alias, str) - - # 8i - relPaths=self._internals.relPathsComingFromAlias(alias) - aliases=map(lambda rp, self=self: self._internals.aliasForRelPath(rp), - relPaths) - - str+=self._internals.entityExternalNameForAlias(alias)+' '+alias - - processedAliases_total=[] - for boundAlias in aliases: - currentRelPath=self._internals.relPathForAlias(boundAlias) - trace('relPath for bound alias: %s'%(currentRelPath)) - - - srcKeys=self._internals.sourceKeysForRelPath(currentRelPath) - dstKeys=self._internals.destinationKeysForRelPath(currentRelPath) - joinClause='' - for idx in range(len(srcKeys)): - joinClause+='%s.%s=%s.%s AND '%(alias, srcKeys[idx], boundAlias, dstKeys[idx]) - joinClause=joinClause[:-5] - if self._joinClauseString: - self._joinClauseString+=' AND '+joinClause - else: - self._joinClauseString=joinClause - - str2, processedAliases=self._addTableJoinsForAlias(boundAlias, '') - str+=', '+str2 - processedAliases_total.extend(processedAliases) - - aliases.extend(processedAliases_total) - aliases.append(alias) - - return (str, aliases) - def columnTypeStringForAttribute(self, attribute): """ --- 51,54 ---- *************** *** 204,205 **** --- 152,159 ---- return values + + + if oracle_server_version()=='9i': + OracleSQLExpression.SQL92_join=1 + else: + OracleSQLExpression.SQL92_join=0 |
From: <sbi...@us...> - 2003-12-15 15:05:03
|
Update of /cvsroot/modeling/ProjectModeling/Modeling/tests In directory sc8-pr-cvs1:/tmp/cvs-serv10442/Modeling/tests Modified Files: test_EditingContext_Global.py Log Message: Fixed bug #857803: mysql: invalid generated sql for complex qualifiers Index: test_EditingContext_Global.py =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/Modeling/tests/test_EditingContext_Global.py,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** test_EditingContext_Global.py 20 Aug 2003 20:39:59 -0000 1.43 --- test_EditingContext_Global.py 15 Dec 2003 15:05:00 -0000 1.44 *************** *** 1273,1276 **** --- 1273,1289 ---- self.assertEqual(res[0].getTitle(), "aBCd") + def test_28_bug857803(self): + "[EditingContext] Complex query bug #857803" + # bug #857803 + #'(age<100) AND ((books.title like "G*") OR (pygmalion.books.title like "G*"))' + ec=EditingContext() + qWQF=qualifierWithQualifierFormat + qualifier=qWQF('(age<100) AND ((books.title like "G*") OR (pygmalion.books.title like "G*"))') + fetchSpec=FetchSpecification(entityName='Writer', qualifier=qualifier) + objects=ec.objectsWithFetchSpecification(fetchSpec) + objects_names=[o.getLastName() for o in objects] + self.failUnless(len(objects)==1) + self.failUnless('Dard' in objects_names) + def test_999_customSQLQuery(self): "[EditingContext] custom SQL Query" |
From: <sbi...@us...> - 2003-12-15 15:05:03
|
Update of /cvsroot/modeling/ProjectModeling/Modeling/DatabaseAdaptors/MySQLAdaptorLayer In directory sc8-pr-cvs1:/tmp/cvs-serv10442/Modeling/DatabaseAdaptors/MySQLAdaptorLayer Modified Files: MySQLSQLExpression.py Log Message: Fixed bug #857803: mysql: invalid generated sql for complex qualifiers Index: MySQLSQLExpression.py =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/Modeling/DatabaseAdaptors/MySQLAdaptorLayer/MySQLSQLExpression.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** MySQLSQLExpression.py 10 Aug 2003 11:59:13 -0000 1.7 --- MySQLSQLExpression.py 15 Dec 2003 15:05:00 -0000 1.8 *************** *** 34,39 **** __version__='$Revision$'[11:-2] from Modeling.SQLExpression import SQLExpression, DateType, CharacterType ! from Modeling.logging import trace import string --- 34,40 ---- __version__='$Revision$'[11:-2] + from Modeling.DatabaseAdaptors.MySQLAdaptorLayer.mysql_utils import * from Modeling.SQLExpression import SQLExpression, DateType, CharacterType ! from Modeling.logging import trace, db_trace import string *************** *** 44,47 **** --- 45,49 ---- available SQL data types. """ + def columnTypeStringForAttribute(self, attribute): """ *************** *** 119,177 **** return values - def _addTableJoinsForAlias(self, alias, str): - """ - Changes the default way the Modeling.SQLExpression calculates SQL - statements for JOIN. - - The default produces:: - - table0 alias0 INNER JOIN [ (some other nested join) | table1 alias1 ] - ON (join condition) - - from which you get a syntax error from mysql. Instead, the previous - statement should be changed to:: - - [ (some other nested join) | table1 alias1 ] INNER JOIN table0 alias0 - ON (join condition) - - Source: http://www.mysql.com/doc/en/JOIN.html in ''User Comments'', - see the first comment. - - See initial bug report at: - https://sourceforge.net/tracker/index.php?func=detail&aid=614261&group_id=58935&atid=489335 - - """ - trace('alias: %s / str: %s'%(alias, str)) - relPaths=self._internals.relPathsComingFromAlias(alias) - aliases=map(lambda rp, self=self: self._internals.aliasForRelPath(rp), - relPaths) - - t=self._internals.entityExternalNameForAlias(alias)+' '+alias - - if not aliases: str+=t - processedAliases_total=[] - for boundAlias in aliases: - currentRelPath=self._internals.relPathForAlias(boundAlias) - trace('relPath for bound alias: %s'%(currentRelPath)) - str2, processedAliases=self._addTableJoinsForAlias(boundAlias, '') - if string.find(str2, 'JOIN')!=-1: - str+=' ( '+str2+' ) ' - else: - str+=str2 - str+=' '+self.sqlStringForJoinSemantic(self._internals.joinSemanticForRelPath(currentRelPath))+' ' - str+=t - str+=' ON ( ' - srcKeys=self._internals.sourceKeysForRelPath(currentRelPath) - dstKeys=self._internals.destinationKeysForRelPath(currentRelPath) - for idx in range(len(srcKeys)): - str+='%s.%s=%s.%s AND '%(alias, srcKeys[idx], boundAlias, dstKeys[idx]) - str=str[:-5]+' ) ' - processedAliases_total.extend(processedAliases) - - aliases.extend(processedAliases_total) - aliases.append(alias) - - return (str, aliases) - def prepareSelectCountExpressionWithAttributes(self, attributes,lock,fetchSpec): --- 121,124 ---- *************** *** 234,239 **** self._whereClauseString=self.sqlStringForQualifier(fullQualifier) - joinClause='' - # Do we join some tables? multiple_tables_joined=len(self.entityExternalNamesByAliases())>1 --- 181,184 ---- *************** *** 253,263 **** columnList=' COUNT(*) ' - fetchOrder=None whereClause=self.whereClauseString() # orderBy: see fetchSpec... orderByClause='' # tableList=self.tableListWithRootEntity(self.entity()) self.assembleSelectStatementWithAttributes(attributes=attributes, lock=lock, --- 198,211 ---- columnList=' COUNT(*) ' whereClause=self.whereClauseString() # orderBy: see fetchSpec... orderByClause='' + fetchOrder=None # tableList=self.tableListWithRootEntity(self.entity()) + # The join clause is now built, if necessary + joinClause=self.joinClauseString() + self.assembleSelectStatementWithAttributes(attributes=attributes, lock=lock, *************** *** 296,297 **** --- 244,250 ---- return SQLExpression.sqlStringForSelector(self, selector, value) + + if mysql_server_version()[:2]>=(4,0): + MySQLSQLExpression.SQL92_join=1 + else: + MySQLSQLExpression.SQL92_join=0 |
From: <sbi...@us...> - 2003-12-15 15:05:03
|
Update of /cvsroot/modeling/ProjectModeling/Modeling In directory sc8-pr-cvs1:/tmp/cvs-serv10442/Modeling Modified Files: SQLExpression.py Log Message: Fixed bug #857803: mysql: invalid generated sql for complex qualifiers Index: SQLExpression.py =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/Modeling/SQLExpression.py,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** SQLExpression.py 31 Aug 2003 13:54:20 -0000 1.23 --- SQLExpression.py 15 Dec 2003 15:05:00 -0000 1.24 *************** *** 266,270 **** ## END / Internals ! def __init__(self, anEntity=None): """ --- 266,272 ---- ## END / Internals ! ! SQL92_join=1 # see _addTableJoinsForAlias() for details ! def __init__(self, anEntity=None): """ *************** *** 1462,1470 **** Calculates the SQL statements for JOIN. ! The default produces:: table0 alias0 INNER JOIN [ (some other nested join) | table1 alias1 ] ON (join condition) """ trace('alias: %s / str: %s'%(alias, str)) --- 1464,1480 ---- Calculates the SQL statements for JOIN. ! The default returns:: table0 alias0 INNER JOIN [ (some other nested join) | table1 alias1 ] ON (join condition) + except if self.SQL92_join is false: in this case, what is identified as + the "join condition" here above is appended to self._joinClauseString (for + use inside a WHERE clause), and the returned string is simply "table0 + alias0, table1 alias1, ..." + + + Returns: (str, aliases): a string (see above) and the list of aliases that + were used to compute the string. """ trace('alias: %s / str: %s'%(alias, str)) *************** *** 1479,1494 **** currentRelPath=self._internals.relPathForAlias(boundAlias) trace('relPath for bound alias: %s'%(currentRelPath)) ! str+=' '+self.sqlStringForJoinSemantic(self._internals.joinSemanticForRelPath(currentRelPath))+' ' ! str2, processedAliases=self._addTableJoinsForAlias(boundAlias, '') ! if string.find(str2, 'JOIN')!=-1: ! str+=' ( '+str2+' ) ' ! else: ! str+=str2 ! str+=' ON ' srcKeys=self._internals.sourceKeysForRelPath(currentRelPath) dstKeys=self._internals.destinationKeysForRelPath(currentRelPath) for idx in range(len(srcKeys)): ! str+='%s.%s=%s.%s AND '%(alias, srcKeys[idx], boundAlias, dstKeys[idx]) ! str=str[:-5] processedAliases_total.extend(processedAliases) --- 1489,1516 ---- currentRelPath=self._internals.relPathForAlias(boundAlias) trace('relPath for bound alias: %s'%(currentRelPath)) ! if self.SQL92_join: ! str+=' '+self.sqlStringForJoinSemantic(self._internals.joinSemanticForRelPath(currentRelPath))+' ' ! str2, processedAliases=self._addTableJoinsForAlias(boundAlias, '') ! if string.find(str2, 'JOIN')!=-1: ! str+=' ( '+str2+' ) ' ! else: ! str+=str2 ! str+=' ON ' srcKeys=self._internals.sourceKeysForRelPath(currentRelPath) dstKeys=self._internals.destinationKeysForRelPath(currentRelPath) + joinClause='' for idx in range(len(srcKeys)): ! joinClause+='%s.%s=%s.%s AND '%(alias, srcKeys[idx], boundAlias, dstKeys[idx]) ! joinClause=joinClause[:-5] ! ! if self.SQL92_join: ! str+=joinClause ! else: ! if self._joinClauseString: ! self._joinClauseString+=' AND '+joinClause ! else: ! self._joinClauseString=joinClause ! str2, processedAliases=self._addTableJoinsForAlias(boundAlias, '') ! str+=', '+str2 processedAliases_total.extend(processedAliases) |
From: <sbi...@us...> - 2003-12-15 15:05:03
|
Update of /cvsroot/modeling/ProjectModeling In directory sc8-pr-cvs1:/tmp/cvs-serv10442 Modified Files: CHANGES Log Message: Fixed bug #857803: mysql: invalid generated sql for complex qualifiers Index: CHANGES =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/CHANGES,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** CHANGES 5 Dec 2003 14:19:58 -0000 1.26 --- CHANGES 15 Dec 2003 15:05:00 -0000 1.27 *************** *** 8,11 **** --- 8,13 ---- -------------------------------------------------------- + * Fixed bug #857803: mysql: invalid generated sql for complex qualifiers + * Fixed bug #854630: an empty qualifier string made ec.fetch() fail |
From: <sbi...@us...> - 2003-12-05 14:20:02
|
Update of /cvsroot/modeling/ProjectModeling/Modeling/tests In directory sc8-pr-cvs1:/tmp/cvs-serv23431/Modeling/tests Modified Files: test_Qualifier.py Log Message: Fixed bug #854630: an empty qualifier string made ec.fetch() fail Index: test_Qualifier.py =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/Modeling/tests/test_Qualifier.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** test_Qualifier.py 10 Jul 2003 11:57:55 -0000 1.9 --- test_Qualifier.py 5 Dec 2003 14:19:59 -0000 1.10 *************** *** 321,324 **** --- 321,331 ---- self.failUnless(len(res)==3 and self.douglas in res and self.victor in res and self.dummy in res) + def test_09_empty_qualifier_string(self): + "[Qualifier] Empty qualifier string" # bug #854630 + q=qualifierWithQualifierFormat('') + self.assertEqual(None, q) + q=qualifierWithQualifierFormat(None) + self.assertEqual(None, q) + # Build the test suite def test_suite(): |
From: <sbi...@us...> - 2003-12-05 14:20:02
|
Update of /cvsroot/modeling/ProjectModeling/Modeling In directory sc8-pr-cvs1:/tmp/cvs-serv23431/Modeling Modified Files: QualifierParser.py Log Message: Fixed bug #854630: an empty qualifier string made ec.fetch() fail Index: QualifierParser.py =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/Modeling/QualifierParser.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** QualifierParser.py 15 Jul 2003 09:30:59 -0000 1.11 --- QualifierParser.py 5 Dec 2003 14:19:58 -0000 1.12 *************** *** 542,545 **** --- 542,547 ---- def qualifierWithQualifierFormat(anExpression): "Used by Qualifier.qualifierFromQualifierFormat" + if not anExpression: + return None from cStringIO import StringIO strIO=StringIO(anExpression) |
From: <sbi...@us...> - 2003-12-05 14:20:02
|
Update of /cvsroot/modeling/ProjectModeling In directory sc8-pr-cvs1:/tmp/cvs-serv23431 Modified Files: CHANGES Log Message: Fixed bug #854630: an empty qualifier string made ec.fetch() fail Index: CHANGES =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/CHANGES,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** CHANGES 16 Nov 2003 17:40:23 -0000 1.25 --- CHANGES 5 Dec 2003 14:19:58 -0000 1.26 *************** *** 8,11 **** --- 8,13 ---- -------------------------------------------------------- + * Fixed bug #854630: an empty qualifier string made ec.fetch() fail + 0.9-pre-16 (2003/11/16) ----------------------- |
From: <sbi...@us...> - 2003-11-16 17:42:06
|
Update of /cvsroot/modeling/ProjectModeling In directory sc8-pr-cvs1:/tmp/cvs-serv30575 Modified Files: vertoo.data Log Message: Release 0.9pre16 Index: vertoo.data =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/vertoo.data,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** vertoo.data 13 Sep 2003 14:54:23 -0000 1.9 --- vertoo.data 16 Nov 2003 17:41:22 -0000 1.10 *************** *** 1,2 **** ! mdl-code = major:0; minor:9; pre:15; release:x; date:Sep 13, 2003; ! mdl_doc = major:0; minor:9; pre:15; release:x; date:Sep 13, 2003; \ No newline at end of file --- 1,2 ---- ! mdl-code = major:0; minor:9; pre:16; release:x; date:Nov 16, 2003; ! mdl_doc = major:0; minor:9; pre:16; release:x; date:Nov 16, 2003; \ No newline at end of file |
From: <sbi...@us...> - 2003-11-16 17:41:06
|
Update of /cvsroot/modeling/ProjectModeling In directory sc8-pr-cvs1:/tmp/cvs-serv30223 Modified Files: CHANGES Log Message: Release 0.9pre16 Index: CHANGES =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/CHANGES,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** CHANGES 16 Nov 2003 17:08:00 -0000 1.24 --- CHANGES 16 Nov 2003 17:40:23 -0000 1.25 *************** *** 8,11 **** --- 8,14 ---- -------------------------------------------------------- + 0.9-pre-16 (2003/11/16) + ----------------------- + * Fixed bug #839231: python code generated in -B/--base mode made it impossible to import a class having sub-classes at first (it was raising |
From: <sbi...@us...> - 2003-11-16 17:15:06
|
Update of /cvsroot/modeling/ProjectModeling In directory sc8-pr-cvs1:/tmp/cvs-serv24931 Modified Files: MANIFEST.in Log Message: Fixed: tests/xmlmodels also contains pymodels Index: MANIFEST.in =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/MANIFEST.in,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** MANIFEST.in 20 Aug 2003 20:45:16 -0000 1.14 --- MANIFEST.in 16 Nov 2003 17:14:22 -0000 1.15 *************** *** 18,22 **** include Modeling/tests/Oracle.cfg ! recursive-include Modeling/tests/xmlmodels *.txt *.xml include Modeling/DatabaseAdaptors/COPYING --- 18,22 ---- include Modeling/tests/Oracle.cfg ! recursive-include Modeling/tests/xmlmodels *.txt *.xml *.py include Modeling/DatabaseAdaptors/COPYING |
From: <sbi...@us...> - 2003-11-16 17:08:44
|
Update of /cvsroot/modeling/ProjectModeling/Modeling/doc/HomePage In directory sc8-pr-cvs1:/tmp/cvs-serv23575/Modeling/doc/HomePage Modified Files: main.tex downloads.tex Log Message: Release 0.9pre16 Index: main.tex =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/Modeling/doc/HomePage/main.tex,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** main.tex 16 Nov 2003 16:24:59 -0000 1.28 --- main.tex 16 Nov 2003 17:08:01 -0000 1.29 *************** *** 7,11 **** % Increment the release number whenever significant changes are made. % The author and/or editor can define 'significant' however they like. ! %\release{0.9-pre-15} % At minimum, give your name and an email address. You can include a --- 7,11 ---- % Increment the release number whenever significant changes are made. % The author and/or editor can define 'significant' however they like. ! %\release{0.9-pre-16} % At minimum, give your name and an email address. You can include a *************** *** 13,17 **** \author{S\'ebastien Bigaret} \email{sbi...@us...} ! \date{Sep 13, 2003} %\date{\today} --- 13,17 ---- \author{S\'ebastien Bigaret} \email{sbi...@us...} ! \date{Nov 16, 2003} %\date{\today} Index: downloads.tex =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/Modeling/doc/HomePage/downloads.tex,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** downloads.tex 13 Sep 2003 14:54:02 -0000 1.17 --- downloads.tex 16 Nov 2003 17:08:01 -0000 1.18 *************** *** 10,14 **** \begin{enumerate} ! \item[\bf Current version: 0.9-pre-15] Download it here:\begin{rawhtml}<a --- 10,14 ---- \begin{enumerate} ! \item[\bf Current version: 0.9-pre-16] Download it here:\begin{rawhtml}<a |
From: <sbi...@us...> - 2003-11-16 17:08:43
|
Update of /cvsroot/modeling/ProjectModeling/Modeling/doc In directory sc8-pr-cvs1:/tmp/cvs-serv23575/Modeling/doc Modified Files: UserGuide.tex Tutorial.tex Log Message: Release 0.9pre16 Index: UserGuide.tex =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/Modeling/doc/UserGuide.tex,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** UserGuide.tex 21 Sep 2003 18:50:37 -0000 1.32 --- UserGuide.tex 16 Nov 2003 17:08:00 -0000 1.33 *************** *** 24,28 **** \date{Sep 21, 2003} %\date{\today} ! \release{0.9-pre-15} %\setreleaseinfo{pre-8} \setshortversion{0.9} --- 24,28 ---- \date{Sep 21, 2003} %\date{\today} ! \release{0.9-pre-16} %\setreleaseinfo{pre-8} \setshortversion{0.9} Index: Tutorial.tex =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/Modeling/doc/Tutorial.tex,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Tutorial.tex 13 Sep 2003 14:54:02 -0000 1.11 --- Tutorial.tex 16 Nov 2003 17:08:00 -0000 1.12 *************** *** 14,18 **** \date{February 10, 2003} %\date{\today} ! \release{0.9-pre-15} %\setreleaseinfo{5} \setshortversion{0.9} --- 14,18 ---- \date{February 10, 2003} %\date{\today} ! \release{0.9-pre-16} %\setreleaseinfo{5} \setshortversion{0.9} |
From: <sbi...@us...> - 2003-11-16 17:08:43
|
Update of /cvsroot/modeling/ProjectModeling In directory sc8-pr-cvs1:/tmp/cvs-serv23575 Modified Files: setup.py CHANGES Log Message: Release 0.9pre16 Index: setup.py =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/setup.py,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** setup.py 6 Oct 2003 22:28:52 -0000 1.35 --- setup.py 16 Nov 2003 17:08:00 -0000 1.36 *************** *** 81,85 **** setup(name="ModelingCore", ! version="0.9-pre-15", license ="GNU General Public License", description=short_description, --- 81,85 ---- setup(name="ModelingCore", ! version="0.9-pre-16", license ="GNU General Public License", description=short_description, Index: CHANGES =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/CHANGES,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** CHANGES 15 Nov 2003 13:26:27 -0000 1.23 --- CHANGES 16 Nov 2003 17:08:00 -0000 1.24 *************** *** 3,7 **** Module Modeling --------------- ! Current release is: 0.9-pre-15 / See also: TODO, INSTALL and doc/ * ** Distributed under the GNU General Public License ** --- 3,7 ---- Module Modeling --------------- ! Current release is: 0.9-pre-16 / See also: TODO, INSTALL and doc/ * ** Distributed under the GNU General Public License ** |
From: <sbi...@us...> - 2003-11-16 16:50:32
|
Update of /cvsroot/modeling/ProjectModeling/Modeling/doc/www In directory sc8-pr-cvs1:/tmp/cvs-serv20691/doc/www Modified Files: menu-inline-begin.tex Log Message: main splitted in main+features Index: menu-inline-begin.tex =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/Modeling/doc/www/menu-inline-begin.tex,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** menu-inline-begin.tex 1 Sep 2003 21:15:51 -0000 1.8 --- menu-inline-begin.tex 16 Nov 2003 16:49:57 -0000 1.9 *************** *** 3,8 **** <tr><td width="20%" valign="top"><br><br><br> ! <a href="quick_overview.html">Quick example</a><br><br> ! <a href="main.html">Features</a><br><br> <a href="status.html">Project's status</a><br> <a href="contributors.html">Contributors</a><br> --- 3,11 ---- <tr><td width="20%" valign="top"><br><br><br> ! <a href="main.html">Home</a><br> ! <a href="features.html">Features</a><br> ! <br> ! <a href="quick_overview.html">Quick example</a><br> ! <br> <a href="status.html">Project's status</a><br> <a href="contributors.html">Contributors</a><br> |
From: <sbi...@us...> - 2003-11-16 16:50:07
|
Update of /cvsroot/modeling/ProjectModeling/Modeling/doc/HomePage In directory sc8-pr-cvs1:/tmp/cvs-serv20613/doc/HomePage Modified Files: features.tex quick_overview.tex Log Message: Added notes about on-the-fly creation of python modules/classes based on a model Index: features.tex =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/Modeling/doc/HomePage/features.tex,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** features.tex 16 Nov 2003 16:24:59 -0000 1.1 --- features.tex 16 Nov 2003 16:49:23 -0000 1.2 *************** *** 51,56 **** \item Generation of database schemas (including: primary keys, foreign keys, ! referential constraints), generation of python code templates ready to ! be used. \item Support for transparent mapping of (class) inheritance in relational --- 51,64 ---- \item Generation of database schemas (including: primary keys, foreign keys, ! referential constraints), ! ! \item Generation of python code templates ready to be used\footnote{Note that ! code generation is not the only way to go, and is only provided so that ! one can easily bootstrap modules/classes based on a model. Python ! classes and modules can be dynamically built from a model at runtime; if ! you're interested in such a feature, you want to have a look at ! \begin{rawhtml}<a ! href="https://sourceforge.net/tracker/index.php?func=detail&aid=814055&group_id=58935&atid=489337">this ! patch</a>\end{rawhtml} for details. } \item Support for transparent mapping of (class) inheritance in relational Index: quick_overview.tex =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/Modeling/doc/HomePage/quick_overview.tex,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** quick_overview.tex 11 Nov 2003 22:25:05 -0000 1.3 --- quick_overview.tex 16 Nov 2003 16:49:23 -0000 1.4 *************** *** 85,102 **** {\tt shell> mdl_generate_python_code.py sample_pymodel.py} \item[Generate the corresponding database schema] Either get the coresponding sql statements: \begin{verbatim} ! shell> mdl_generate_DB_schema.py -c -A sample_pymodel.py \end{verbatim} %\begin{verbatim} ! %shell> mdl_generate_DB_schema.py -c -A sample_pymodel.py ! %DROP SEQUENCE PK_SEQ_PERSON; ! %DROP SEQUENCE PK_SEQ_ADDRESS; ! %ALTER TABLE ADDRESS DROP CONSTRAINT person; ! %ALTER TABLE PERSON DROP CONSTRAINT PERSON_pkey; ! %ALTER TABLE ADDRESS DROP CONSTRAINT ADDRESS_pkey; ! %DROP TABLE PERSON; ! %DROP TABLE ADDRESS; %CREATE TABLE PERSON ( % FIRST_NAME VARCHAR(40) , --- 85,102 ---- {\tt shell> mdl_generate_python_code.py sample_pymodel.py} + Note: python modules and classes can also be generated dynamically on the + fly.\\ + If you're interested in such a feature, you want to have a look at + \begin{rawhtml}<a + href="https://sourceforge.net/tracker/index.php?func=detail&aid=814055&group_id=58935&atid=489337">this + patch</a>\end{rawhtml} for details. + \item[Generate the corresponding database schema] Either get the coresponding sql statements: \begin{verbatim} ! shell> mdl_generate_DB_schema.py -c -C sample_pymodel.py \end{verbatim} %\begin{verbatim} ! %shell> mdl_generate_DB_schema.py -c -C sample_pymodel.py %CREATE TABLE PERSON ( % FIRST_NAME VARCHAR(40) , *************** *** 117,127 **** \begin{rawhtml} <pre> - DROP SEQUENCE PK_SEQ_PERSON; - DROP SEQUENCE PK_SEQ_ADDRESS; - <strong>ALTER</strong> <strong>TABLE</strong> ADDRESS DROP <strong>CONSTRAINT</strong> person; - <strong>ALTER</strong> <strong>TABLE</strong> PERSON DROP <strong>CONSTRAINT</strong> PERSON_pkey; - <strong>ALTER</strong> <strong>TABLE</strong> ADDRESS DROP <strong>CONSTRAINT</strong> ADDRESS_pkey; - DROP <strong>TABLE</strong> PERSON; - DROP <strong>TABLE</strong> ADDRESS; <strong>CREATE</strong> <strong>TABLE</strong> PERSON ( FIRST_NAME <font color="#2040a0"><strong>VARCHAR</strong></font><strong>(</strong>40) , --- 117,120 ---- |
From: <sbi...@us...> - 2003-11-16 16:25:43
|
Update of /cvsroot/modeling/ProjectModeling/Modeling/doc/HomePage In directory sc8-pr-cvs1:/tmp/cvs-serv15960/doc/HomePage Modified Files: main.tex Added Files: features.tex Log Message: main splitted in main+features --- NEW FILE: features.tex --- \documentclass{article} \title{Modeling\\ Object-Relational Bridge for python } % Increment the release number whenever significant changes are made. % The author and/or editor can define 'significant' however they like. %\release{0.9-pre-15} % At minimum, give your name and an email address. You can include a % snail-mail address if you like. \author{S\'ebastien Bigaret} %\email{sbi...@us...} %\date{Sep 13, 2003} %\date{\today} \begin{document} \input{www/menu-inline-begin} \maketitle % Copyright statement should go here, if needed. % ... % The abstract should be a paragraph or two long, and describe the % scope of the document. %\begin{abstract} %\end{abstract} \chapter{Features} The framework allows you to transparently create, retrieve, update or delete python objects from a database without having to write a single line of SQL. It achieves this by offering you a container, the \verb+EditingContext+ (see the \begin{rawhtml}<a href="UserGuide/index.html">User's Guide</a>\end{rawhtml}) that is responsible for your objects. Additionally the framework offers: \begin{itemize} \item A comprehensive model description language (XML) to specify how the object model is to map to a relational model, \item Functional tools to help you designing your model (in the form of either a Zope poduct, or a collection of standalone utility scripts), that can also validate your models against the most common errors made when designing a model. \item Generation of database schemas (including: primary keys, foreign keys, referential constraints), generation of python code templates ready to be used. \item Support for transparent mapping of (class) inheritance in relational databases. \item A simple and powerful object-oriented query langage. \item Once you get one or more objects, using that query langage, you do not need to explicitly fetch the objects in relations to the ones you already fetched. Rather, you simply use normal python getters to traverse relationships, and the related objects are automatically fetched, when needed and when appropriate. It helps you keep the memory footprint of your applications reasonable, while keeping you away from the SQL world. \item Automatic checking for referential-integrity constraints, plus the framework provides a unified place where to put your own validation logic (objects' invariants, ...) so that they are integrated in the checked constraints. \item Automatically encloses all modifications made to a graph/set of objects in a transactional scheme, so that the changes are all saved, or none are saved. \item Support for nested graphs/sets of objects. \item Works with python 2.1 and 2.2. \end{itemize} \paragraph*{Supported RDBMS} \begin{description} \item[\begin{rawhtml}<a href="http://www.mysql.com/">MySQL</a>\end{rawhtml}] tested with v3.23.52 and v4.0.13 Supported python adaptor: \begin{rawhtml} <a href="http://sourceforge.net/projects/mysql-python">MySQL</a> \end{rawhtml} \item[\begin{rawhtml}<a href="http://www.oracle.com/">Oracle</a>\end{rawhtml}] tested with Oracle 8i (linux/8.1.7.0.1) and Oracle 9i (9.2.0.1.0/linux) Supported python adaptor: \begin{rawhtml} <a href="http://www.zope.org/Members/matt/dco2">DCOracle2</a> \end{rawhtml} \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). Supported python adaptors: \begin{rawhtml} <a href="http://initd.org/software/initd/psycopg">psycopg</a> \end{rawhtml} or \begin{rawhtml} <a href="http://www.druid.net/pygresql/">PyGreSQL</a>(pgdb) \end{rawhtml} or \begin{rawhtml} <a href="http://pypgsql.sourceforge.net">PyPgSQL</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} %The framework is currently in an alpha stage. There are several reasons for %this, but the main ones are: %\begin{itemize} %\item it has not been used extensively tested %\item it has not been optimized at well (except for some particular points), %\item there are still important points on the TODO list that needs to be done %\end{itemize} \input{www/menu-inline-end} \end{document} Index: main.tex =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/Modeling/doc/HomePage/main.tex,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** main.tex 13 Sep 2003 14:54:02 -0000 1.27 --- main.tex 16 Nov 2003 16:24:59 -0000 1.28 *************** *** 42,150 **** ! See also: the \begin{rawhtml}<a href="#disclaimer">disclaimer</a>\end{rawhtml} ! ! \chapter{Features} ! ! The framework allows you to transparently create, retrieve, update or delete ! python objects from a database without having to write a single line of ! SQL. It achieves this by offering you a container, the ! \verb+EditingContext+ (see the \begin{rawhtml}<a ! href="UserGuide/index.html">User's Guide</a>\end{rawhtml}) that is ! responsible for your objects. ! ! Additionally the framework offers: ! ! \begin{itemize} ! ! \item A comprehensive model description language (XML) to specify how the object ! model is to map to a relational model, ! ! \item Functional tools to help you designing your model (in the form of ! either a Zope poduct, or a collection of standalone utility scripts), ! that can also validate your models against the ! most common errors made when designing a model. ! ! \item Generation of database schemas (including: primary keys, foreign keys, ! referential constraints), generation of python code templates ready to ! be used. ! ! \item Support for transparent mapping of (class) inheritance in relational ! databases. ! ! \item A simple and powerful object-oriented query langage. ! ! \item Once you get one or more objects, using that query langage, you do not ! need to explicitly fetch the objects in relations to the ones you ! already fetched. Rather, you simply use normal python getters to ! traverse relationships, and the related objects are automatically ! fetched, when needed and when appropriate. It helps you keep the memory ! footprint of your applications reasonable, while keeping you away from ! the SQL world. ! ! \item Automatic checking for referential-integrity constraints, plus the ! framework provides a unified place where to put your own validation ! logic (objects' invariants, ...) so that they are integrated in the ! checked constraints. ! ! \item Automatically encloses all modifications made to a graph/set of objects ! in a transactional scheme, so that the changes are all saved, or none ! are saved. ! ! \item Support for nested graphs/sets of objects. ! ! ! \item Works with python 2.1 and 2.2. ! \end{itemize} ! ! \paragraph*{Supported RDBMS} ! ! \begin{description} ! \item[\begin{rawhtml}<a href="http://www.mysql.com/">MySQL</a>\end{rawhtml}] ! tested with v3.23.52 and v4.0.13 ! ! Supported python adaptor: ! \begin{rawhtml} ! <a href="http://sourceforge.net/projects/mysql-python">MySQL</a> ! \end{rawhtml} ! ! \item[\begin{rawhtml}<a href="http://www.oracle.com/">Oracle</a>\end{rawhtml}] ! tested with Oracle 8i (linux/8.1.7.0.1) and Oracle 9i (9.2.0.1.0/linux) ! ! Supported python adaptor: ! \begin{rawhtml} ! <a href="http://www.zope.org/Members/matt/dco2">DCOracle2</a> ! \end{rawhtml} ! ! ! \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). ! ! ! Supported python adaptors: ! \begin{rawhtml} ! <a href="http://initd.org/software/initd/psycopg">psycopg</a> ! \end{rawhtml} or ! \begin{rawhtml} ! <a href="http://www.druid.net/pygresql/">PyGreSQL</a>(pgdb) ! \end{rawhtml} or ! \begin{rawhtml} ! <a href="http://pypgsql.sourceforge.net">PyPgSQL</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} - %The framework is currently in an alpha stage. There are several reasons for - %this, but the main ones are: - %\begin{itemize} - %\item it has not been used extensively tested - %\item it has not been optimized at well (except for some particular points), - %\item there are still important points on the TODO list that needs to be done - %\end{itemize} \begin{rawhtml}<hr noshade><a name="disclaimer">\end{rawhtml} --- 42,49 ---- ! See also: \begin{rawhtml}<a href="features.html">the list of the main ! features</a>.\end{rawhtml} \begin{rawhtml}<hr noshade><a name="disclaimer">\end{rawhtml} |
From: <sbi...@us...> - 2003-11-15 13:26:30
|
Update of /cvsroot/modeling/ProjectModeling/Modeling/ModelMasons/Python_bricks In directory sc8-pr-cvs1:/tmp/cvs-serv26638/Modeling/ModelMasons/Python_bricks Modified Files: init_base.tmpl module_base.tmpl Log Message: Fixed bug #839231: python code generated in -B/--base mode made it impossible to import a class having sub-classes at first (circular imports) Index: init_base.tmpl =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/Modeling/ModelMasons/Python_bricks/init_base.tmpl,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** init_base.tmpl 26 May 2003 15:44:48 -0000 1.2 --- init_base.tmpl 15 Nov 2003 13:26:27 -0000 1.3 *************** *** 3,7 **** # WARNING: Any changes made here will be OVERWRITTEN next time the package # is regenerated - #for entities in $entitiesSet: - import $(entities[0].moduleName()) - #end for --- 3,4 ---- Index: module_base.tmpl =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/Modeling/ModelMasons/Python_bricks/module_base.tmpl,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** module_base.tmpl 6 Sep 2003 11:48:05 -0000 1.5 --- module_base.tmpl 15 Nov 2003 13:26:28 -0000 1.6 *************** *** 1,5 **** ## This template will build the module #import time ! import $(base_dir) # Generated by mdl_generate_python_code.py / $(time.strftime("%Y/%m/%d %H:%M")) from Modeling.Validation import ValidationException --- 1,11 ---- ## This template will build the module #import time ! ! #for entity in $entities: ! #set $class_name = $entity.className() ! #set $module_name = $entity.moduleName() ! from $(base_dir).$(module_name) import $(class_name) as $(base_dir)_$(module_name)_$(class_name) ! #end for ! # Generated by mdl_generate_python_code.py / $(time.strftime("%Y/%m/%d %H:%M")) from Modeling.Validation import ValidationException *************** *** 13,19 **** $entity_props.sort(lambda x,y: cmp(x.name(), y.name())) #if $entity.parentEntity(): ! class $(class_name)($(base_dir).$(module_name).$(class_name)): #derive from $(entity.parentEntity().className()) #else ! class $(class_name)($(base_dir).$(module_name).$(class_name)): #end if """ --- 19,25 ---- $entity_props.sort(lambda x,y: cmp(x.name(), y.name())) #if $entity.parentEntity(): ! class $(class_name)($(base_dir)_$(module_name)_$(class_name)): #derive from $(entity.parentEntity().className()) #else ! class $(class_name)($(base_dir)_$(module_name)_$(class_name)): #end if """ *************** *** 26,30 **** # every parameter gets a default value, since the framework needs to be # able to instanciate an object with no parameter at all. ! $(base_dir).$(module_name).$(class_name).__init__(self) for k,v in kw.items(): self.takeValueForKey(v, k) --- 32,36 ---- # every parameter gets a default value, since the framework needs to be # able to instanciate an object with no parameter at all. ! $(base_dir)_$(module_name)_$(class_name).__init__(self) for k,v in kw.items(): self.takeValueForKey(v, k) |
From: <sbi...@us...> - 2003-11-15 13:26:30
|
Update of /cvsroot/modeling/ProjectModeling In directory sc8-pr-cvs1:/tmp/cvs-serv26638 Modified Files: CHANGES Log Message: Fixed bug #839231: python code generated in -B/--base mode made it impossible to import a class having sub-classes at first (circular imports) Index: CHANGES =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/CHANGES,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** CHANGES 15 Nov 2003 13:02:40 -0000 1.22 --- CHANGES 15 Nov 2003 13:26:27 -0000 1.23 *************** *** 8,11 **** --- 8,15 ---- -------------------------------------------------------- + * Fixed bug #839231: python code generated in -B/--base mode made it + impossible to import a class having sub-classes at first (it was raising + because of circular imports). + * Fixed bug #842698: when a PyModel.Attribute property is set after instanciation, its value was never propagated to the final Attribute at |
From: <sbi...@us...> - 2003-11-15 13:02:45
|
Update of /cvsroot/modeling/ProjectModeling/Modeling/tests In directory sc8-pr-cvs1:/tmp/cvs-serv23271/Modeling/tests Modified Files: test_PyModel.py Log Message: * Fixed bug #842698: when a PyModel.Attribute property is set after instanciation, its value was never propagated to the final Attribute at build() time. * Fixed bug #841315: PyModel associations do not set the multiplicity bounds e.g. a toOne relationship was always [0,1] regardless of what the definition of the Association. Index: test_PyModel.py =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/Modeling/tests/test_PyModel.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** test_PyModel.py 3 Aug 2003 12:54:09 -0000 1.5 --- test_PyModel.py 15 Nov 2003 13:02:41 -0000 1.6 *************** *** 90,94 **** self.failIf(emp.propertyNamed('id') not in toMarks.sourceAttributes()) self.failIf(mark.propertyNamed('fkEmployee') not in toMarks.destinationAttributes()) ! self.failIf(fkStore.isRequired()!=toStore.multiplicityLowerBound()) # Check toStore and toMarks for SalesClerk --- 90,94 ---- self.failIf(emp.propertyNamed('id') not in toMarks.sourceAttributes()) self.failIf(mark.propertyNamed('fkEmployee') not in toMarks.destinationAttributes()) ! self.failIf(fkStore.isRequired()!=toStore.multiplicityLowerBound(), '%i != %i'%(fkStore.isRequired(),toStore.multiplicityLowerBound())) # Check toStore and toMarks for SalesClerk *************** *** 148,151 **** --- 148,170 ---- self.assertEqual(emp.primaryKeyAttributes()[0].defaultValue(), None) + def test_01b_attr(self): + "[PyModel] attributes' props can be reassigned before build()" + # bug #842698 + model = self.model + model.entities = [ + Entity('Employee', properties=[ AString('firstName', width=30) ] ), + ] + attr=model.entityNamed('Employee').attributeNamed('firstName') + attr.width=50 + attr.isRequired=1 + attr.usedForLocking=1 + model.build() + emp=model.component.entityNamed('Employee') + self.checkEntitiesProperties((emp,)) + firstName=emp.attributeNamed('firstName') + self.assertEqual(firstName.width(), 50) + self.assertEqual(firstName.isRequired(), 1) + self.failUnless(firstName in emp.attributesUsedForLocking()) + def test_02_pk(self): "[PyModel] entity w/ pk" *************** *** 402,408 **** --- 421,429 ---- self.failUnless(mark.propertyNamed('fkEmployee')) self.failIf(emp.propertyNamed('toStore').deleteRule()!='nullify') + self.failUnless(emp.propertyNamed('toStore').isMandatory()) #841315 self.failIf(emp.propertyNamed('toMarks').deleteRule()!='cascade') self.failIf(store.propertyNamed('toEmployees').deleteRule()!='deny') self.failIf(mark.propertyNamed('toEmployee').deleteRule()!='nullify') + self.failUnless(mark.propertyNamed('toEmployee').isMandatory()) # Check Association's defaults |
From: <sbi...@us...> - 2003-11-15 13:02:45
|
Update of /cvsroot/modeling/ProjectModeling In directory sc8-pr-cvs1:/tmp/cvs-serv23271 Modified Files: CHANGES Log Message: * Fixed bug #842698: when a PyModel.Attribute property is set after instanciation, its value was never propagated to the final Attribute at build() time. * Fixed bug #841315: PyModel associations do not set the multiplicity bounds e.g. a toOne relationship was always [0,1] regardless of what the definition of the Association. Index: CHANGES =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/CHANGES,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** CHANGES 4 Oct 2003 12:53:43 -0000 1.21 --- CHANGES 15 Nov 2003 13:02:40 -0000 1.22 *************** *** 8,11 **** --- 8,19 ---- -------------------------------------------------------- + * Fixed bug #842698: when a PyModel.Attribute property is set after + instanciation, its value was never propagated to the final Attribute at + build() time. + + * Fixed bug #841315: PyModel associations do not set the multiplicity bounds + e.g. a toOne relationship was always [0,1] regardless of what the + definition of the Association. + * RFE #812708: mdl_generate_db_schema.py now automatically adds a semi-colon (';') when option '-c' is enabled. A new option (-e/--end-with) is added |
From: <sbi...@us...> - 2003-11-15 13:02:45
|
Update of /cvsroot/modeling/ProjectModeling/Modeling In directory sc8-pr-cvs1:/tmp/cvs-serv23271/Modeling Modified Files: PyModel.py Log Message: * Fixed bug #842698: when a PyModel.Attribute property is set after instanciation, its value was never propagated to the final Attribute at build() time. * Fixed bug #841315: PyModel associations do not set the multiplicity bounds e.g. a toOne relationship was always [0,1] regardless of what the definition of the Association. Index: PyModel.py =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/Modeling/PyModel.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PyModel.py 30 Aug 2003 12:55:05 -0000 1.6 --- PyModel.py 15 Nov 2003 13:02:41 -0000 1.7 *************** *** 526,530 **** def build(self, model, entity): ! pass def clone(self): --- 526,535 ---- def build(self, model, entity): ! d={} ! selfdict=self.__dict__ ! [d.setdefault(k, selfdict[k]) for k in selfdict.keys() ! if k in Attribute.defaults.keys()] ! updateComponent(self, d, Attribute.defaults, self.name, ! ignore=('usedForLocking')) def clone(self): *************** *** 891,900 **** srcAtt=AForeignKey(self.keys[0]) srcE.properties.append(srcAtt) ! ## Now srcAtt and dstAtt are set # Relationships toOne_kw={} ; toMany_kw={} ! for k in ('delete','isClassProperty','joinSemantic','displayLabel','doc'): toOne_kw[k]=getattr(self, k)[0] toMany_kw[k]=getattr(self, k)[1] --- 896,907 ---- srcAtt=AForeignKey(self.keys[0]) srcE.properties.append(srcAtt) ! # automatic creation of the FK: set isRequired if applicable ! srcAtt.isRequired=self.multiplicity[0][0] ## Now srcAtt and dstAtt are set # Relationships toOne_kw={} ; toMany_kw={} ! for k in ('delete','isClassProperty','joinSemantic','displayLabel','doc', ! 'multiplicity'): toOne_kw[k]=getattr(self, k)[0] toMany_kw[k]=getattr(self, k)[1] |
From: <sbi...@us...> - 2003-11-11 22:25:08
|
Update of /cvsroot/modeling/ProjectModeling/Modeling/doc/HomePage In directory sc8-pr-cvs1:/tmp/cvs-serv17877/doc/HomePage Modified Files: quick_overview.tex Log Message: Fixed a shell cmd for db-schema generation, based on a remark by Lukasz Lakomy. Thanks! Index: quick_overview.tex =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/Modeling/doc/HomePage/quick_overview.tex,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** quick_overview.tex 6 Sep 2003 11:56:08 -0000 1.2 --- quick_overview.tex 11 Nov 2003 22:25:05 -0000 1.3 *************** *** 145,149 **** Or create the database directly: \begin{verbatim} ! shell> mdl_generate_DB_schema.py -c -C --admin-dsn="localhost:template1:postgres:" sample_pymodel.py \end{verbatim} --- 145,149 ---- Or create the database directly: \begin{verbatim} ! shell> mdl_generate_DB_schema.py -C --admin-dsn="localhost:template1:postgres:" sample_pymodel.py \end{verbatim} |
From: <sbi...@us...> - 2003-11-11 14:51:25
|
Update of /cvsroot/modeling/ProjectModeling/Modeling/tests In directory sc8-pr-cvs1:/tmp/cvs-serv14689 Modified Files: test_generate_python_code.sh Log Message: Added detection code for ticket #839231 Index: test_generate_python_code.sh =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/Modeling/tests/test_generate_python_code.sh,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** test_generate_python_code.sh 3 Aug 2003 12:49:58 -0000 1.4 --- test_generate_python_code.sh 11 Nov 2003 14:51:21 -0000 1.5 *************** *** 32,39 **** --- 32,73 ---- } + function check_success() { + if [ $? -ne 0 ]; then + echo "ERROR: Failed: $1" 1>&2 + else + echo "OK: Success: $1" + fi + } + function check_failure() { + if [ $? -ne 0 ]; then + echo "OK: Failed: $1" 1>&2 + else + echo "ERROR: Success: $1" + fi + } + function test_AuthorBooks() { execute $PYTHON ./test_EditingContext_Global.py } function test_StoreEmployees() { + # Bug #839231: impossible to load classes w/ sub-classes prior to classes + # w/o subclasses. So we test here that we can load every possible + # module/class in the generated package + # Note: fix_StoreEmployees() is needed before this, just like the test.py + # does. + cd testPackages + TEST_IMPORT="from StoreEmployees.Store import Store" + $PYTHON -c "$TEST_IMPORT" ; check_success "$TEST_IMPORT" + TEST_IMPORT="from StoreEmployees.Employee import Employee" + $PYTHON -c "$TEST_IMPORT" ; check_success "$TEST_IMPORT" + TEST_IMPORT="from StoreEmployees.SalesClerk import SalesClerk" + $PYTHON -c "$TEST_IMPORT" ; check_success "$TEST_IMPORT" + TEST_IMPORT="from StoreEmployees.Executive import Executive" + $PYTHON -c "$TEST_IMPORT" ; check_success "$TEST_IMPORT" + TEST_IMPORT="from StoreEmployees.Mark import Mark" + $PYTHON -c "$TEST_IMPORT" ; check_success "$TEST_IMPORT" + TEST_IMPORT="from StoreEmployees.Holidays import Holidays" + $PYTHON -c "$TEST_IMPORT" ; check_success "$TEST_IMPORT" + cd .. execute $PYTHON ./test_EditingContext_Global_Inheritance.py } *************** *** 50,67 **** } - function check_success() { - if [ $? -ne 0 ]; then - echo "ERROR: Failed: $1" 1>&2 - else - echo "OK: Success: $1" - fi - } - function check_failure() { - if [ $? -ne 0 ]; then - echo "OK: Failed: $1" 1>&2 - else - echo "ERROR: Success: $1" - fi - } function generate() { execute $PYTHON $GENERATE $* --- 84,87 ---- |