I am seeing an interesting formatting bug with the display of time and date fields. I cannot resolve where this lies (cherrypy, cheetah, mysql or sqlobject). I am pretty sure it's not in the cherrypy, although I could be wrong.

What happens is that the first field displayed shows the date time correctly when called and displayed, ending in HH:MM:SS, but the second field (sometimes) shows HH:MM:SS.uuuuuu, that is the extra resolution. Examination of the MySQL database using the command line does not show the added resolution in the field itself. Examination of the record using the python interpreter doesn't hold any clues, it looks to be without resolution when returned by sqlobject. Finally if I take this sqlobject record and pass it through my cheetah function to render to html, the result is clean - no extra digits.

In summary, the same record retrieved from the database shows no resolution except when displayed in my application, not when I run each of the sub components. This IMPLIES that it is cherrypy that is adding the resolution, but that really cannot be so because the string returned from cheetah is clean.

cheetah template: <div><table><tr><td>$rec.dbByDateTime</td><td>$rec.dbAckDateTime</td></tr></table></div>

result from cheetah parsing (interpreter):
<div><table><tr><td>2006-04-06 15:27:07 </td><td>2006-04-26 08:45:06</td></tr></table></div>

in the application:
<div><table><tr><td>2006-04-06 15:27:07</td><td>2006-04-26 08:45:06.3750000</td></tr></table></div>

class Document (SQLObject) :
    dbCreated = DateTimeCol()
    dbModified = DateTimeCol(default = None)

When the record is created I do this:
Document(dbCreated = datetime.now())
and when modified I do this:
d = Document.get(1)
d.set(dbModified = datetime.now())

BTW, I am on win32 using cherrypy 2.1, mysql 4.1.3, sqlobject 0.7.0, python 2.4 and Cheetah 0.9.18.

--



-------------------------------------------------------
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&kid=120709&bid=263057&dat=121642
_______________________________________________
sqlobject-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to