server/sources/native.py
changeset 6366 1806148d6ce8
parent 6333 e3994fcc21c3
parent 6359 0bff5a05385c
child 6426 541659c39f6a
equal deleted inserted replaced
6333:e3994fcc21c3 6366:1806148d6ce8
   140 
   140 
   141 def rdef_physical_info(dbhelper, rdef):
   141 def rdef_physical_info(dbhelper, rdef):
   142     """return backend type and a boolean flag if NULL values should be allowed
   142     """return backend type and a boolean flag if NULL values should be allowed
   143     for a given relation definition
   143     for a given relation definition
   144     """
   144     """
   145     coltype = y2sql.type_from_constraints(dbhelper, rdef.object,
   145     if rdef.object.final:
       
   146         ttype = rdef.object
       
   147     else:
       
   148         ttype = 'Int' # eid type
       
   149     coltype = y2sql.type_from_constraints(dbhelper, ttype,
   146                                           rdef.constraints, creating=False)
   150                                           rdef.constraints, creating=False)
   147     allownull = rdef.cardinality[0] != '1'
   151     allownull = rdef.cardinality[0] != '1'
   148     return coltype, allownull
   152     return coltype, allownull
   149 
   153 
   150 class UndoException(Exception):
   154 class UndoException(Exception):