Closed alfonsodg closed 10 years ago
From massimod...@gmail.com on September 01, 2010 11:12:47
I think the problem is trying to insert a date in datetime. Please try replace datetime.date with datetime.datetime
do you think this should be supported?
From mulone.m...@gmail.com on September 01, 2010 12:47:17
yes you are right this is the problem. Mmmh I think this is not a must, perhaps better raise exception.
From massimod...@gmail.com on September 12, 2010 20:14:36
I changed it and you should no longer get any error. Please check it.
Status: Fixed
From mulone.m...@gmail.com on September 01, 2010 13:07:38
This raise an exception in GAE, in sqlite all working fine. This is web2py from trunk.
models/db.py
import datetime db.define_table('posts',
db.Field('id', 'id'),
db.Field('title', 'string', length=255, default=""),
db.Field('created_on', 'datetime'), migrate=True)
posts = db(db.posts.id>0).select() if not posts: id1 = db.posts.insert(title="This is my 1 title",created_on=datetime.date(2010, 9, 1)) id2 = db.posts.insert(title="This is my 2 title",created_on=datetime.date(2010, 8, 31)) id3 = db.posts.insert(title="This is my 3 title",created_on=datetime.date(2010, 8, 30)) id4 = db.posts.insert(title="This is my 4 title",created_on=datetime.date(2010, 7, 20)) id5 = db.posts.insert(title="This is my 5 title",created_on=datetime.date(2010, 5, 15))
controllers/default.py
def index(): import datetime
Attachment: web2py.app.datesgae.w2p
Original issue: http://code.google.com/p/web2py/issues/detail?id=104