aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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!"))