[Modeling-users] different models in same package
Status: Abandoned
Brought to you by:
sbigaret
|
From: Mario R. <ma...@ru...> - 2003-12-05 06:58:56
|
Hi,
I have two models that I am setting to be in the same
package, so I have something like:
model = Model('pymone', packageName='packone',
connDict={'database':'db_pymone.db'})
model = Model('pymtwo', packageName='packone',
connDict={'database':'db_pymtwo.db'})
in the respective pymodel files. All entity names are distinct
across both models.
The code generation into the same package, and the generation of
the two db's is fine. However, when I import entities form the second
model, what seems to happen is that the first model "becomes known"
but the entity (as it is in the other model) returns None... to clarify:
% python
[GCC Apple cpp-precomp 6.14] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from packone.EntInOne import EntInOne
>>> from Modeling.ModelSet import defaultModelSet
>>> ms = defaultModelSet()
>>> ms.modelsNames()
['pymone']
>>> ms.entityNamed('EntInOne')
<Modeling.Entity.Entity instance at 0x7d3140>
>>> from packone.EntInTwo import EntInTwo
>>> ms.modelsNames()
['pymone']
>>> ms.entityNamed('EntInTwo')
>>> ^D
if I only import an entity form the second model, the same thing
happens:
% python
[GCC Apple cpp-precomp 6.14] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from packone.EntInTwo import EntInTwo
>>> from Modeling.ModelSet import defaultModelSet
>>> ms = defaultModelSet()
>>> ms.modelsNames()
['pymone']
>>> ms.entityNamed('EntInTwo')
>>> ^D
Am I abusing something here?
Let me know if I should put in a report.
Cheers, mario
|