sqlite is does not enforce field types (web2py does).  You are storing
a string in place of date.



On May 26, 8:48 pm, liugehao <[email protected]> wrote:
> thanks
>
> model:
>
> import datetime
> now=datetime.datetime.now()
>
> db.define_table('entry',SQLField('category','integer'),
>     SQLField('title','string',length=50),
>     SQLField('content','text'),
>     SQLField('tag','string',length=150),
>     SQLField('inputtime','datetime',default=now),
>     SQLField('pubed','integer',default=0)
>
>     )
>
> the field 'inputtime' type is 'timestamp'
>
> >>import sqlite3
> >>conn=sqlite3.connect('/home/liugehao/web2py/applications/databases/storage.db')
> >>cur=conn.cursor()
> >>cur.execute("insert into entry (title,content,inputtime) values 
> >>(?,?,?)",['title','content','2009-1-1 1:12:22'])
>
> the data fixed,but why it use split ?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to