From b0b656dd9d3c048fc41d333fbe56b3cd01d34212 Mon Sep 17 00:00:00 2001 From: "Peter J. Holzer" Date: Fri, 18 Aug 2023 12:00:00 +0200 Subject: [PATCH] Add weights --- new_meet | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/new_meet b/new_meet index c192a09..8364d7d 100755 --- a/new_meet +++ b/new_meet @@ -32,19 +32,19 @@ meet_id = csr.fetchone().id for date in meet["dates"]: csr.execute( - "insert into date(date, display, meet) values(%s, %s, %s)", - (date["date"], date.get("display"), meet_id,) + "insert into date(date, display, w, meet) values(%s, %s, %s, %s)", + (date["date"], date.get("display"), date.get("w", 1), meet_id,) ) for time in meet["times"]: csr.execute( - "insert into time(time, display, meet) values(%s, %s, %s)", - (time["time"], time.get("display"), meet_id,) + "insert into time(time, display, w, meet) values(%s, %s, %s, %s)", + (time["time"], time.get("display"), time.get("w", 1), meet_id,) ) for place in meet["places"]: csr.execute( - "insert into place(name, meet) values(%s, %s)", - (place["name"], meet_id,) + "insert into place(name, w, meet) values(%s, %s, %s)", + (place["name"], place.get("w", 1), meet_id,) ) db.commit()