aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Horel <guillaume.horel@gmail.com>2015-03-26 22:47:26 -0400
committerGuillaume Horel <guillaume.horel@gmail.com>2015-03-26 22:47:26 -0400
commitdbd8753c2bdd78d669d9ee9bc353c3f3f4b0b228 (patch)
tree14905aeb6ea2c208048ebeec31d0ff5beed54dac
parent13af51344c06cad01f01c4324744860d52a76ef5 (diff)
downloadwedding-website-dbd8753c2bdd78d669d9ee9bc353c3f3f4b0b228.tar.gz
also store the last time form was updated
-rw-r--r--schema.sql3
-rw-r--r--wedding.py3
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!"))