server/sources/native.py
changeset 11005 f8417bd135ed
parent 10915 cf800aa43f48
child 11091 29aebc1edd29
--- a/server/sources/native.py	Wed Dec 09 17:44:17 2015 +0100
+++ b/server/sources/native.py	Wed Dec 09 17:44:18 2015 +0100
@@ -119,12 +119,9 @@
     """return backend type and a boolean flag if NULL values should be allowed
     for a given relation definition
     """
-    if rdef.object.final:
-        ttype = rdef.object
-    else:
-        ttype = 'Int' # eid type
-    coltype = y2sql.type_from_constraints(dbhelper, ttype,
-                                          rdef.constraints, creating=False)
+    if not rdef.object.final:
+        return dbhelper.TYPE_MAPPING['Int']
+    coltype = y2sql.type_from_rdef(dbhelper, rdef, creating=False)
     allownull = rdef.cardinality[0] != '1'
     return coltype, allownull