The sql expression :
select *
from order
where status=0
and adddate(created_time, interval 1 day)>now();
python code:
from sqlalchemy.sql.expression import func, text
from datetime import datetime
closed_orders = DBSession.query(Order).filter(func.dateadd(Order.create_time, text('interval 1 day'))>datetime.now()).all()
but it's got wrong. how to do it correctly?
thanks
presto: