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
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
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
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,