Re: [SQLObject] PATCH: adds support for an interval timedelta column

2010-01-15 Thread Oleg Broytman
Hello! On Wed, May 13, 2009 at 07:11:22PM +, Matthew Wilson wrote: > Hi -- I wrote some code to add a TimedeltaCol type. I only tested it in > postgresql. I applied both your patches to the trunk, commit 4088. Thank you! Sorry it took so long. > By the way, how do I write a converter tha

Re: [SQLObject] PATCH: adds support for an interval timedelta column

2009-05-18 Thread Daniel Fetchinson
>> Actually, I think TimedeltaCol could be implemented for sqlite as >> well. Although it doesn't have an INTERVAL data type it could use a >> plain TEXT instead and python would do the conversion. As far as I >> know sqlite only knows TEXT anyway so IntCol, StringCol, etc, all >> these things are

Re: [SQLObject] PATCH: adds support for an interval timedelta column

2009-05-15 Thread Oleg Broytmann
On Fri, May 15, 2009 at 10:09:01AM -0700, Daniel Fetchinson wrote: > Actually, I think TimedeltaCol could be implemented for sqlite as > well. Although it doesn't have an INTERVAL data type it could use a > plain TEXT instead and python would do the conversion. As far as I > know sqlite only knows

Re: [SQLObject] PATCH: adds support for an interval timedelta column

2009-05-15 Thread Daniel Fetchinson
>> Here's another test, added to the bottom of test_converters.py: > >Thanks! > >> By the way, how do I write a converter that converts a python object one >> way for one database (sqlite) and another way for another database >> (postgres)? Are there any examples of this already? > >Yes, s

Re: [SQLObject] PATCH: adds support for an interval timedelta column

2009-05-14 Thread Oleg Broytmann
On Thu, May 14, 2009 at 02:32:31PM +, Matthew Wilson wrote: > Here's another test, added to the bottom of test_converters.py: Thanks! > By the way, how do I write a converter that converts a python object one > way for one database (sqlite) and another way for another database > (postgres)

Re: [SQLObject] PATCH: adds support for an interval timedelta column

2009-05-14 Thread Matthew Wilson
On Thu 14 May 2009 10:18:47 AM EDT, Matthew Wilson wrote: > On Wed 13 May 2009 04:35:59 PM EDT, Oleg Broytmann wrote: >> On Wed, May 13, 2009 at 08:05:26PM +, Matthew Wilson wrote: >>> >IWBN to have a test also. >>> >>> I completely agree; can you point me to where in the code I should wri

Re: [SQLObject] PATCH: adds support for an interval timedelta column

2009-05-14 Thread Oleg Broytmann
On Thu, May 14, 2009 at 02:18:47PM +, Matthew Wilson wrote: > I'm trying to write a test, but it seems like all the tests use a sqlite > database, and sqlite doesn't support an interval datatype. > > Not sure what to do at this point. Here's the test (absolutely > nothing fancy here): > >

Re: [SQLObject] PATCH: adds support for an interval timedelta column

2009-05-14 Thread Matthew Wilson
On Wed 13 May 2009 04:35:59 PM EDT, Oleg Broytmann wrote: > On Wed, May 13, 2009 at 08:05:26PM +, Matthew Wilson wrote: >> >IWBN to have a test also. >> >> I completely agree; can you point me to where in the code I should write >> the test? Also, are there any tests I can use as a guide?

Re: [SQLObject] PATCH: adds support for an interval timedelta column

2009-05-13 Thread Oleg Broytmann
On Wed, May 13, 2009 at 08:05:26PM +, Matthew Wilson wrote: > >IWBN to have a test also. > > I completely agree; can you point me to where in the code I should write > the test? Also, are there any tests I can use as a guide? Any test script would be ok - I'll convert it to the test s

Re: [SQLObject] PATCH: adds support for an interval timedelta column

2009-05-13 Thread Matthew Wilson
On Wed 13 May 2009 03:39:01 PM EDT, Oleg Broytmann wrote: > On Wed, May 13, 2009 at 07:11:22PM +, Matthew Wilson wrote: >> Hi -- I wrote some code to add a TimedeltaCol type. I only tested it in >> postgresql. > >Thank you! > >> +def TimedeltaConverter(value, db): >> + >> +return "

Re: [SQLObject] PATCH: adds support for an interval timedelta column

2009-05-13 Thread Oleg Broytmann
On Wed, May 13, 2009 at 07:11:22PM +, Matthew Wilson wrote: > Hi -- I wrote some code to add a TimedeltaCol type. I only tested it in > postgresql. Thank you! > +def TimedeltaConverter(value, db): > + > +return """INTERVAL '%d days %d seconds'""" % \ > +(value.days, value.