modify date format
authorJulien Rabier <taziden@flexiden.org>
Tue, 22 May 2012 22:07:18 +0000 (00:07 +0200)
committerJulien Rabier <taziden@flexiden.org>
Tue, 22 May 2012 22:07:18 +0000 (00:07 +0200)
main.py
schema.sql

diff --git a/main.py b/main.py
index bd87c9a..c1ba962 100755 (executable)
--- 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'))
index 836a026..d138caa 100644 (file)
@@ -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
 );