server/sources/native.py
changeset 11005 f8417bd135ed
parent 10915 cf800aa43f48
child 11091 29aebc1edd29
equal deleted inserted replaced
11004:14ba505fb652 11005:f8417bd135ed
   117 
   117 
   118 def rdef_physical_info(dbhelper, rdef):
   118 def rdef_physical_info(dbhelper, rdef):
   119     """return backend type and a boolean flag if NULL values should be allowed
   119     """return backend type and a boolean flag if NULL values should be allowed
   120     for a given relation definition
   120     for a given relation definition
   121     """
   121     """
   122     if rdef.object.final:
   122     if not rdef.object.final:
   123         ttype = rdef.object
   123         return dbhelper.TYPE_MAPPING['Int']
   124     else:
   124     coltype = y2sql.type_from_rdef(dbhelper, rdef, creating=False)
   125         ttype = 'Int' # eid type
       
   126     coltype = y2sql.type_from_constraints(dbhelper, ttype,
       
   127                                           rdef.constraints, creating=False)
       
   128     allownull = rdef.cardinality[0] != '1'
   125     allownull = rdef.cardinality[0] != '1'
   129     return coltype, allownull
   126     return coltype, allownull
   130 
   127 
   131 
   128 
   132 class _UndoException(Exception):
   129 class _UndoException(Exception):