From c21567b46e215f51586dec05cb20c30112017863 Mon Sep 17 00:00:00 2001 From: Julien Rabier Date: Wed, 23 May 2012 00:07:18 +0200 Subject: [PATCH] modify date format --- main.py | 4 +++- schema.sql | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index bd87c9a..c1ba962 100755 --- a/main.py +++ b/main.py @@ -38,8 +38,10 @@ def show_votes(): def add_vote(): if not session.get('logged_in'): abort(401) + daten = date.today() + timedelta(days=60) + ndate = daten.strftime('%d %B %Y') g.db.execute('insert into votes (title, description, date) values (?, ?, ?)', - [request.form['title'], request.form['description'], date.today() + timedelta(days=60)]) + [request.form['title'], request.form['description'], ndate]) g.db.commit() flash('New entry was successfully posted') return redirect(url_for('show_votes')) diff --git a/schema.sql b/schema.sql index 836a026..d138caa 100644 --- a/schema.sql +++ b/schema.sql @@ -3,6 +3,6 @@ create table votes ( id integer primary key autoincrement, title string not null, description string not null, - date datetime not null + date string not null ); -- 2.20.1