[sqlalchemy] Re: using datetime objects in queries

2008-01-31 Thread Cliff Wells
This appears to be a bug in SA 0.4.2p3: From the datetime docs: ''' Note: In order to stop comparison from falling back to the default scheme of comparing object addresses, datetime comparison normally raises TypeError if the other comparand isn't also a datetime object. However, NotImplemented

[sqlalchemy] Re: using datetime objects in queries

2008-01-31 Thread Michael Bayer
if you compare from the left to the right, it will work: table.c.column = start_date the DateTime type itself is not part of the operation at the python comparison level. On Jan 31, 2008, at 4:02 PM, Cliff Wells wrote: This appears to be a bug in SA 0.4.2p3: From the datetime docs:

[sqlalchemy] Re: using datetime objects in queries

2008-01-31 Thread Rooju Chokshi
Hello Cliff, I'm using datetime queries to filter results based on a date interval. You could try using the between() construct to get the records you desire. Something like this: q = q.filter(between(Post.c.post_date,start_date,end_date)) Specifying the query this way works for me. Hope that

[sqlalchemy] Re: using datetime objects in queries

2008-01-31 Thread Cliff Wells
On Thu, 2008-01-31 at 16:19 -0500, Michael Bayer wrote: if you compare from the left to the right, it will work: table.c.column = start_date the DateTime type itself is not part of the operation at the python comparison level. Also, just monkeypatching a timetuple = None onto the

[sqlalchemy] Re: using datetime objects in queries

2008-01-31 Thread jason kirtland
Cliff Wells wrote: This appears to be a bug in SA 0.4.2p3: From the datetime docs: ''' Note: In order to stop comparison from falling back to the default scheme of comparing object addresses, datetime comparison normally raises TypeError if the other comparand isn't also a datetime