OK, great. the docs are in fact missing something, but nothing to do
with SQLite. they are missing the fact that the Date,Time, DateTime
types all take datetime objects as arguments, not floats. and
perhaps that the objects should have explicit checks for datetime
types (although that would prohibit ducktyping, such as for
mxDateTime objects)
change it to :
import datetime
...
SamplePage = Page(name=u"SamplePage", data=u"""This is a sample
page""", timestamp=datetime.datetime.today())
and for "print p.data, p.timestamp" youll get full results, i.e.
"This is a sample page 2006-04-27 21:43:07.970716" .
On Apr 27, 2006, at 8:12 PM, Jon Rosebaugh wrote:
On 4/27/06, Michael Bayer <[EMAIL PROTECTED]> wrote:
On Apr 27, 2006, at 6:15 PM, Jon Rosebaugh wrote:
Yeah, that makes sense, I guess. I just expected SA to be able to
read
out what it itself had put into the database.
it does. theres unit tests that pass. can you attach a test case
that fails ?
from sqlalchemy import *
import time
pages = Table('pages',
Column('page_id', Integer, primary_key=True),
Column('name', Unicode(60), nullable=False),
Column('data', Unicode, nullable=True),
Column('timestamp', DateTime, nullable=False)
)
class Page(object):
def __init__(self, page_id=None, name=None, data=None,
timestamp=None):
self.page_id = page_id
self.name = name
self.data = data
self.timestamp = timestamp
assign_mapper(Page, pages)
global_connect('sqlite://filename=test.db')
pages.create()
SamplePage = Page(name=u"SamplePage", data=u"""This is a sample
page""", timestamp=time.time())
objectstore.commit()
objectstore.clear()
p = Page.get_by(name=u"SamplePage")
print p.data
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services,
security?
Get stuff done quickly with pre-integrated technology to make your
job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache
Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642
_______________________________________________
Sqlalchemy-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642
_______________________________________________
Sqlalchemy-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users