aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/handle_default.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/python/handle_default.py b/python/handle_default.py
index 00d640a7..8ca423b7 100644
--- a/python/handle_default.py
+++ b/python/handle_default.py
@@ -38,11 +38,12 @@ def create_newindices(recordslist, recovery, lastdate, conn):
with conn.cursor() as c:
newids = {}
for r in recordslist:
- r["indexfactor"] -= r["orig_weight"]
- r["version"] += 1
- r["cumulativeloss"] += (100 - recovery) * r["orig_weight"] / 100
- r["lastdate"] = "infinity"
- c.execute(insertstr, r)
+ d = r._asdict()
+ d["indexfactor"] -= d["orig_weight"]
+ d["version"] += 1
+ d["cumulativeloss"] += (100 - recovery) * d["orig_weight"] / 100
+ d["lastdate"] = "infinity"
+ c.execute(insertstr, d)
newids[r["basketid"]] = c.fetchone()[0]
for oldid in newids.keys():
c.execute(updatestr, (lastdate, oldid))