Compare commits

...

2 Commits

Author SHA1 Message Date
Peter J. Holzer ad68bd86d3 Print summary of newly created meet 2025-01-27 21:35:55 +01:00
Peter J. Holzer a211048920 Don't insert weights
They aren't used and I don't even remember what they were for.
2025-01-27 21:34:36 +01:00
1 changed files with 10 additions and 6 deletions

View File

@ -32,19 +32,23 @@ meet_id = csr.fetchone().id
for date in meet["dates"]:
csr.execute(
"insert into date(date, display, w, meet) values(%s, %s, %s, %s)",
(date["date"], date.get("display"), date.get("w", 1), meet_id,)
"insert into date(date, display, meet) values(%s, %s, %s)",
(date["date"], date.get("display"), meet_id,)
)
for time in meet["times"]:
csr.execute(
"insert into time(time, display, w, meet) values(%s, %s, %s, %s)",
(time["time"], time.get("display"), time.get("w", 1), meet_id,)
"insert into time(time, display, meet) values(%s, %s, %s)",
(time["time"], time.get("display"), meet_id,)
)
for place in meet["places"]:
csr.execute(
"insert into place(name, w, meet) values(%s, %s, %s)",
(place["name"], place.get("w", 1), meet_id,)
"insert into place(name, meet) values(%s, %s)",
(place["name"], meet_id,)
)
db.commit()
csr.execute("select * from meet where id = %s", (meet_id,))
r = csr.fetchone()
print(r.id, r.key, r.title)