|
@@ -126,9 +126,12 @@ def parseLookup(lookup,qv):
|
|
|
qv=qv.replace('Č','C')
|
|
qv=qv.replace('Č','C')
|
|
|
return lookup[qv]
|
|
return lookup[qv]
|
|
|
|
|
|
|
|
-def asKey(qv):
|
|
|
|
|
|
|
+def asKey(qv,field):
|
|
|
if not qv:
|
|
if not qv:
|
|
|
return qv
|
|
return qv
|
|
|
|
|
+ if not field['type']=='int':
|
|
|
|
|
+ return qv
|
|
|
|
|
+
|
|
|
try:
|
|
try:
|
|
|
return int(qv)
|
|
return int(qv)
|
|
|
except (TypeError,ValueError):
|
|
except (TypeError,ValueError):
|
|
@@ -387,7 +390,7 @@ def importData(pars,filename,getId=getId,modify=modify,\
|
|
|
if convertLookup(v):
|
|
if convertLookup(v):
|
|
|
qv=parseLookup(lookupMap[f],qv)
|
|
qv=parseLookup(lookupMap[f],qv)
|
|
|
else:
|
|
else:
|
|
|
- qv=asKey(qv)
|
|
|
|
|
|
|
+ qv=asKey(qv,fields[f])
|
|
|
|
|
|
|
|
|
|
|
|
|
if f in dateVars:
|
|
if f in dateVars:
|