Re: [Modeling-users] Pythonic, and non-XML, Model description
Status: Abandoned
Brought to you by:
sbigaret
|
From: Sebastien B. <sbi...@us...> - 2003-05-18 16:25:36
|
Hi,
A little more on the current choices and implementation for PyModels.
> Association('E1', 'E2',
> multiplicity =3D [ [0,1], [0,None] ], # optional or mandato=
ry?
> relations =3D [ 'toE2', 'toE1s' ], # optional=20
> keys =3D [ 'fkE2', 'id' ], # optional
> delete =3D [ 'nullify', 'nullify' ], # optional
> isClassProperty =3D [ 1, 1 ], # optional
> joinSemantic =3D [ 0, 0 ], # optional
> displayLabel =3D [ '', '' ], # optional
> doc=3D ['to one', 'to many' ], # optional
> )
Branch brch-0_9pre7-1-PyModel now fully implements this API for
associations. The multiplicity is *optional*, this means that:
> Another thing I must stress is that Association currently associates
> E1 --> E2, w/ E1:toOne-->E2 and E2:toMany-->E1
is still correct.
> [About modeling the StoreEmployees model]
Mario> > Nice. Version with Associations and no Relationships?
The StoreEmployees model is also fully implemented with Associations
only and can be found at
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/modeling/ProjectModeling/Mod=
eling/tests/testPackages/StoreEmployees/Attic/pymodel_StoreEmployees.py?rev=
=3D1.1.2.2&only_with_tag=3Dbrch-0_9pre7-1-PyModel&content-type=3Dtext/vnd.v=
iewcvs-markup
It passes the framework's tests (cf. test_Editing_Global_Inheritance).
Last (off-topic but it will be integrated in the next release): I
changed the way delete rules are stored for relationships: instead of
integers, they are now stored as plain strings ('nullify', 'deny',
'cascade'): this makes things clearer. Of course, you can count on
backward compatibility and your (xml)models storing the delete rules as
integers are still loadable.
Again, it is not because implementation has begun that things cannot
be changed; it's there so that those of you who want to play w/ it can
make some experimentations. However and still, you do not need to
download the code to comment the sample PyModel for StoreEmployees.
Regards,
-- S=E9bastien.
|