Re: [sqlalchemy] How to filter by date with SA 0.6?

2010-08-17 Thread David Gardner
try this: from sqlalchemy import func session.query(MyObj).fitler(func.strftime('%Y',MyObj.date_field)=='2004').all() On 08/16/2010 01:03 PM, Italo Maia wrote: By the way, sqlite here! 2010/8/16 Italo Maia italo.m...@gmail.com mailto:italo.m...@gmail.com How's the best way to filter a

[sqlalchemy] How to filter by date with SA 0.6?

2010-08-16 Thread Italo Maia
How's the best way to filter a date field by year? -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalch...@googlegroups.com. To unsubscribe from this group, send email to

Re: [sqlalchemy] How to filter by date with SA 0.6?

2010-08-16 Thread Italo Maia
By the way, sqlite here! 2010/8/16 Italo Maia italo.m...@gmail.com How's the best way to filter a date field by year? -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalch...@googlegroups.com. To

Re: [sqlalchemy] How to filter by date with SA 0.6?

2010-08-16 Thread Lance Edgar
On Mon, 2010-08-16 at 13:01 -0700, Italo Maia wrote: How's the best way to filter a date field by year? Maybe something like: from sqlalchemy import and_ import datetime relevant_year = 1978 query = session.query(MyClass).filter(and_( MyClass.my_date = datetime.date(relevant_year, 1,