Ignore:
Timestamp:
26/06/12 10:36:22 (8 years ago)
Author:
mnagni
Message:

Stable release 0.1.0

File:
1 edited

Legend:

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

    r8084 r8393  
    33#set ($rn = ${associationTable.rightTable.associatedClass.name.toLowerCase()}) 
    44#set ($ln = ${associationTable.leftTable.associatedClass.name.toLowerCase()}) 
    5 ${rn}_${ln}#end 
    6  
    7 #macro( substituteClassType $typeName) 
    8 #if($typeName.equals('CharacterString')) 
    9 str#elseif($typeName.equals('Character')) 
    10 str#else 
    11 ${typeName} 
    12 #end 
    13 #end 
     5#set ($name = "${rn}_${ln}") 
     6${vh.limitLenght($name)}#end 
    147 
    158#macro( tableName $tableModel) 
     
    3023#set ($tmn = $tableModel.associatedClass.name) 
    3124#if ($relation.isManyToMany()) 
    32 '${relation.name}': relationship(${tt}, secondary=#associationTableName($relation.associationTable)_table)#if($hasNext),#end 
     25'${relation.name.trim()}': relationship(${tt}, secondary=#associationTableName($relation.associationTable)_table)#if($hasNext),#end 
    3326#elseif($relation.isOneToMany()) 
    34 '${relation.name}': relationship(${tt}, primaryjoin=${tt.toLowerCase()}_table.c.${ft.toLowerCase()}_${relation.name.toLowerCase()}==${tmn.toLowerCase()}_table.c.id)#if($hasNext),#end 
     27'${relation.name}': relationship(${tt}, primaryjoin=${tt.toLowerCase()}_table.c.${ft.toLowerCase()}_${relation.name.toLowerCase().trim()}==${tmn.toLowerCase()}_table.c.id)#if($hasNext),#end 
    3528#elseif($relation.isOneToOne()) 
    36 '${relation.name}': relationship(${tt}, uselist=False, backref='${relation.backrefName}', primaryjoin=${tt.toLowerCase()}_table.c.${ft.toLowerCase()}_${relation.name.toLowerCase()}_id==${tmn.toLowerCase()}_table.c.id)#if($hasNext),#end 
     29'${relation.name}': relationship(${tt}, uselist=False, backref='${relation.backrefName}', primaryjoin=${tt.toLowerCase()}_table.c.${ft.toLowerCase()}_${relation.name.toLowerCase().trim()}_id==${tmn.toLowerCase()}_table.c.id)#if($hasNext),#end 
    3730#end 
    3831#if($tt == $tmn) 
Note: See TracChangeset for help on using the changeset viewer.