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.
result from cheetah parsing (interpreter):
<div><table><tr><td>2006-04-06 15:27:07 </td><td>2006-04-26
in the application:
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.