Re: [Modeling-users] SQLite, problemas with Floats
Status: Abandoned
Brought to you by:
sbigaret
From: Sebastien B. <sbi...@us...> - 2003-09-17 19:13:07
|
Hi, "Ernesto Revilla" <er...@si...> wrote: > Hi again (sorry for the attack), >=20 > I'm using Modeling 0.9-pre15 and sqlite 2.8.6 >=20 > When I do a fetch for objects with float attributes, these are string and= not float. Say: > .... > >>> accounts=3Dec.fetch('Account') > >>> accounts[0].getAmount() > '0.0' Which version of pysqlite are you currently using? I just checked the recommended version (cf. http://modeling.sf.net/installation.html) i.e. pysqlite v0.4.3, and this version does cast the types as expected: >>> import sqlite >>> sqlite.version '0.4.3' >>> cnx=3Dsqlite.connect('db_AuthorBooks.db') >>> cur=3Dcnx.cursor() >>> cur.execute("SELECT t0.ID, t0.LAST_NAME, t0.FIRST_NAME, t0.AGE, t0.BIRT= HDAY, t0.FK_WRITER_ID FROM WRITER t0 WHERE t0.id=3D1") >>> cur.fetchall() [(1, 'Cleese', 'John', 24, <DateTime object for '1939-10-27 08:31:15.00' at= 81d7ea8>, None)] I couldn't find any clue on when this was introduced, however. Could you check your own version and report? Thanks. -- S=E9bastien. |