From dbd8753c2bdd78d669d9ee9bc353c3f3f4b0b228 Mon Sep 17 00:00:00 2001 From: Guillaume Horel Date: Thu, 26 Mar 2015 22:47:26 -0400 Subject: also store the last time form was updated --- schema.sql | 3 ++- wedding.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/schema.sql b/schema.sql index 1ae7fdd..cdf2678 100644 --- a/schema.sql +++ b/schema.sql @@ -9,5 +9,6 @@ create table guests( plusonename text, kids boolean default 0, kidsnames text, - comments text + comments text, + lastupdate integer(4) default current_timestamp ); diff --git a/wedding.py b/wedding.py index e592f97..bb3df7a 100644 --- a/wedding.py +++ b/wedding.py @@ -82,7 +82,8 @@ def rsvp(): else: args.append(v) update_string = ",".join(update_string) - query = "UPDATE guests set %s WHERE user_name=?" % update_string + query = "UPDATE guests set {0} , lastupdate=current_timestamp " \ + "WHERE user_name=?".format(update_string) with db: db.execute(query, tuple(args+[session['user_name']])) flash(gettext("We have updated your information!")) -- cgit v1.2.3-70-g09d2