Re: [sqlalchemy] Add Support for "24:00:00" with Time type

2012-04-18 Thread Will Weaver
For those that end up being interested in something like this. For the complete round robin I did this. from path.to.time import Time from psycopg2 import extensions def cast_time(value, cur): """Cast postgresql Time type to a Time object""" if value is None: return None re

Re: [sqlalchemy] Add Support for "24:00:00" with Time type

2012-04-18 Thread Will Weaver
On Wed, Apr 18, 2012 at 10:57 AM, Michael Bayer wrote: > > On Apr 18, 2012, at 10:47 AM, Will wrote: > > > Yes, I knew about the adapters. A coworker of mine came up with this: > >... > > s = Session() > c = s.connection() > > cast_time = lambda value, cur: Time.parse(value) > TIME = c.dialec

Re: [sqlalchemy] Add Support for "24:00:00" with Time type

2012-04-18 Thread Michael Bayer
On Apr 18, 2012, at 10:47 AM, Will wrote: > > Yes, I knew about the adapters. A coworker of mine came up with this: > >... > s = Session() > c = s.connection() > > cast_time = lambda value, cur: Time.parse(value) > TIME = c.dialect.dbapi.extensions.new_type((1083,), "TIME", cast_time) >

Re: [sqlalchemy] Add Support for "24:00:00" with Time type

2012-04-18 Thread Will
On Wednesday, April 18, 2012 10:17:43 AM UTC-4, Michael Bayer wrote: > > > On Apr 18, 2012, at 9:36 AM, Will wrote: > > The postgresql Time type supports times from "00:00:00" to "24:00:00" in > accordance with ISO 8601 . > The python datetime.time

Re: [sqlalchemy] Add Support for "24:00:00" with Time type

2012-04-18 Thread Michael Bayer
On Apr 18, 2012, at 9:36 AM, Will wrote: > The postgresql Time type supports times from "00:00:00" to "24:00:00" in > accordance with ISO 8601. The python datetime.time class does not currently > support "24:00:00" but it would be useful to have SQLAlchemy support that. puzzled, looking at

[sqlalchemy] Add Support for "24:00:00" with Time type

2012-04-18 Thread Will
The postgresql Time type supports times from "00:00:00" to "24:00:00" in accordance with ISO 8601 . The python datetime.time class does not currently support "24:00:00" but it would be useful to have SQLAlchemy support that. I'm using SQLAlchemy 0.