|
@@ -313,12 +313,17 @@ def convertLookup(xlsColumnName):
|
|
|
def rowValid(df,r):
|
|
|
return True
|
|
|
|
|
|
+def updateEntry(e):
|
|
|
+ pass
|
|
|
+
|
|
|
def importData(pars,filename,getId=getId,modify=modify,\
|
|
|
convertLookup=convertLookup,dryRun=True,debug=True,
|
|
|
- rowValid=rowValid):
|
|
|
+ rowValid=rowValid,updateEntry=updateEntry):
|
|
|
#master routine that imports data based on pars,
|
|
|
#applies user supplied functions modify, convertLookup and get Id and
|
|
|
#updates relevant database
|
|
|
+#rowValid signals a valid row, argument is current row from xlsx
|
|
|
+#updateEntry adds fields that can be computed from other fields in entry
|
|
|
|
|
|
#some useful fields from pars (d is for default value)
|
|
|
# - skiprows removes irelevant rows (number, d: 0)
|
|
@@ -415,6 +420,7 @@ def importData(pars,filename,getId=getId,modify=modify,\
|
|
|
entry['Date']=entry[dateVariable]
|
|
|
except KeyError:
|
|
|
pass
|
|
|
+ updateEntry(entry)
|
|
|
|
|
|
entries.append(entry)
|
|
|
|