Ignore:
Timestamp:
22/12/11 17:33:24 (8 years ago)
Author:
mnagni
Message:

Again uncompleted deployment in DB. Tomorrow have to check better the primaryjoins!

File:
1 edited

Legend:

Unmodified
Added
Removed
  • mauRepo/xmi2sqlalchemy/trunk/src/main/resources/global_library.vm

    r8027 r8040  
    1 #macro( truncate $text) 
    2 #if($text.length() > 40) 
    3 $text.substring(0, 40)#else$text#end 
    4 #end 
    5  
    61#macro( substituteClassType $typeName) 
    72#if($typeName.equals('CharacterString')) 
     
    3833#set ($ft = $relation.fromTable.associatedClass.name) 
    3934#set ($tmn = $tableModel.associatedClass.name) 
    40 #set ($totalName_1 = "${tt.toLowerCase()}_${ft.toLowerCase()}") 
    41 #set ($totalName_2 = "${ft.toLowerCase()}_${relation.name.toLowerCase()}") 
    4235#if ($relation.isManyToMany()) 
    4336'${relation.name}': relationship(${tt},  
    44 secondary=${totalName_1}_table 
     37secondary=${tt.toLowerCase()}_${ft.toLowerCase()}_table 
    4538#if ($relation.backrefName), backref='${relation.backrefName}' #end 
    4639#elseif($relation.isOneToMany()) 
     
    4841#elseif($relation.isOneToOne()) 
    4942'${relation.name}': relationship(${tt}#end 
    50 #if($relation.isOneToOne() || !$relation.isUseList()) 
    51 , uselist=False 
     43#if($relation.isOneToOne() || !$relation.useList) 
     44, uselist=False, backref='${tmn.toLowerCase()}_${relation.name}' 
    5245#end 
    5346#if($tt == $tmn) 
     
    5548#else 
    5649#end 
    57 #if($relation.isOneToOne() || $relation.isOneToMany()) 
    58 , primaryjoin=${tt.toLowerCase()}_table.c.${totalName_2}==${tmn.toLowerCase()}_table.c.${tmn.toLowerCase()}_id 
     50#if($relation.isOneToMany()) 
     51, primaryjoin=${tt.toLowerCase()}_table.c.${ft.toLowerCase()}_${relation.name}==${tmn.toLowerCase()}_table.c.id 
     52#end 
     53#if($relation.isOneToOne()) 
     54, primaryjoin=${tt.toLowerCase()}_table.c.${ft.toLowerCase()}_${relation.name}_id==${tmn.toLowerCase()}_table.c.id 
    5955#end 
    6056)#end 
Note: See TracChangeset for help on using the changeset viewer.