What's wrong with Member.dateofbirth==datetime.today() ?
On 28 Aug, 2013 7:47 PM, <[email protected]> wrote:

> Hi,
>
> I want to retrieve all the people who are born at today's date. I'm using 
> Flask with sqlalchemy;
>
> class Member(db.Model):
>>
> ...
>
> dateofbirth = Column(Date)
> ...
>
>
> In my view.py;
>
>> from datetime import date, timedelta
>>
> today = date.today()
>>
> members_today = 
> Member.query.filter(Member.dateofbirth.replace(year=today.year) == 
> today).all()
>>
>>
> But I receive this error;
>
>> AttributeError: Neither 'InstrumentedAttribute' object nor 'Comparator'
>> object associated with Member.dateofbirth has an attribute 'replace'
>>
>
> Anyone has an idea?
>
> Thanks
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "sqlalchemy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/sqlalchemy.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to