[PEAK] References between models
    Radek Kanovsky 
    rk at dat.cz
       
    Fri Nov 14 14:12:27 EST 2003
    
    
  
On Fri, Nov 14, 2003 at 12:36:24PM -0500, Phillip J. Eby wrote:
> Okay, then this is a "textbook" example of what module inheritance 
> (peak.config.modules) is intended for.
I knew that it must be simple with python+peak :-)
> Look at the UML13 and UML14 packages in peak.metamodels; there is a nested 
> package called 'model' in each one that is an automatically generated base 
> model.  But, the parent package "inherits" from this nested package, to 
> create a new package, with some alterations.
I had a fear to look at metamodels because when I made grep command
over peak sources during studying, metamodels wrote up eight screens
everytime :-)
    $ rgrep StructuralFeature * | grep -v '^metamodels'
> The tricky bit to use it with your intended use case, is that you need to 
> reorganize so all the model components are together, e.g. instead of 
> comp2.model and comp3.model, you need instead basemodel.comp1 and 
> basemodel.comp2. 
I have "comp4" module as component repository for "wm4" framework
so no reorganization is needed.
  comp4/
      contact/
          __init__.py model.py storage.py ...
      invoice/
          __init__.py model.py storage.py ...
      ....
Many thanks.
RadekK
    
    
More information about the PEAK
mailing list