Re: [Modeling-users] Request for testers: dynamic creation of classes from a model
Status: Abandoned
Brought to you by:
sbigaret
From: Mario R. <ma...@ru...> - 2003-10-20 00:10:39
|
hi, I am following up on these tests with a separate installation of python 2.2.2, to avoid the bug new.instancemethod() in 2.2. The basic tests are successful, but have not had time to experiment with these with my own models. The log for the tests is below. These are running on OS X 10.2.8. Cheers, mario % /sw/bin/python2.2 ./run.py ---------------------------------------------------------------------- Ran 107 tests in 7.663s OK % /sw/bin/python2.2 ./test_EditingContext_Global.py -c -r % /sw/bin/python2.2 ./test_EditingContext_Global.py -c ---------------------------------------------------------------------- Ran 39 tests in 12.770s OK % /sw/bin/python2.2 ./test_EditingContext_Global.py -m -r % /sw/bin/python2.2 ./test_EditingContext_Global.py -m ---------------------------------------------------------------------- Ran 39 tests in 14.627s OK % /sw/bin/python2.2 ./test_EditingContext_Global.py -M -r % /sw/bin/python2.2 ./test_EditingContext_Global.py -M ---------------------------------------------------------------------- Ran 39 tests in 14.023s OK % /sw/bin/python2.2 ./test_EditingContext_Global_Inheritance.py -c ---------------------------------------------------------------------- Ran 22 tests in 17.953s OK % /sw/bin/python2.2 ./test_EditingContext_Global_Inheritance.py -m ---------------------------------------------------------------------- Ran 22 tests in 16.697s OK % /sw/bin/python2.2 ./test_EditingContext_Global_Inheritance.py -M ---------------------------------------------------------------------- Ran 22 tests in 16.719s OK % /sw/bin/python2.2 ./test_EditingContext_ParentChild.py -c ---------------------------------------------------------------------- Ran 16 tests in 6.994s OK % /sw/bin/python2.2 ./test_EditingContext_ParentChild.py -m Ran 16 tests in 5.789s OK % /sw/bin/python2.2 ./test_EditingContext_ParentChild.py -M ---------------------------------------------------------------------- Ran 16 tests in 7.132s OK % > Hi all, > > I've just uploaded a new patch for the new dynamic feature > https://sf.net/tracker/=20 > index.php?func=3Ddetail&aid=3D814055&group_id=3D58935&atid=3D489337 > > Changes are: > > - run.py testsuite has been fixed and should pass now, > - dynamic.build() can now also add properties to the generated > classes (when parameter define_properties is true). Hence tests > have a new option -C ("classic" build w/ properties) > > - toMany relationships are initialized with () (empty tuple) =20 > instead > of [] (empty list). > > Note on properties: while attributes are well handled, they can be > dangerous for relationships when they are stored as list instead of > tuples. For example, in the current version, author.books=3D[] is > correctly handled, but author.books.append(new_book) isn't: it does = not > mark the object as modified, since author.willChange() is not > called. For those who know zodb, the ZODB.Persistent class has the = same > problem in this case, and _p_changed should be manually set to 1. > > It is not clear to me whether a special proxy-class (deriving from > types.ListType) should be specially designed for handling > modifications of lists for relationships. BTW if you store > relationships as tuples, not lists, then the problem disappears. > > -- S=E9bastien. |