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