Re: [SQLObject] patch to add TIMESTAMP to DateTimeConverter
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Matthew W. <ma...@tp...> - 2008-07-31 21:16:47
|
On Thu 31 Jul 2008 05:09:14 PM EDT, Oleg Broytmann wrote: > On Thu, Jul 31, 2008 at 08:58:04PM +0000, Matthew Wilson wrote: >> Index: sqlobject/converters.py >> =================================================================== >> --- sqlobject/converters.py (revision 3536) >> +++ sqlobject/converters.py (working copy) >> @@ -163,7 +163,7 @@ >> registerConverter(time.struct_time, StructTimeConverter) >> >> def DateTimeConverter(value, db): >> - return "'%04d-%02d-%02d %02d:%02d:%02d'" % ( >> + return "TIMESTAMP '%04d-%02d-%02d %02d:%02d:%02d'" % ( >> value.year, value.month, value.day, >> value.hour, value.minute, value.second) > > How do you prevent MySQL and all other database to complain and reject > the query? Converters are used for all kinds of backends, not only for Pg. > Is there some way to write a specific converterjust for postgresql, and then allow other databases to use the original? Can I use the db parameter to find out what database I'm using? Matt |