I have an ORM query as follows
results = db.session.query(MyData).filter(MyData.last_updated_date_time.between(from_date, to_date)).all()
passing parameters for from date is 2020-12-14 04:00:00
and for to date is 2020-12-15 04:00:00
and last_updated_date_time
holds values
2020-12-09 03:08:22.301+00
, 2020-12-14 01:26:30.737+00
all are valid date time objects
This query works fine for some occasions and throws error stating
MyData.last_updated_date_time.between(from_date, to_date)
AttributeError: 'datetime.datetime' object has no attribute 'between'
ERROR:root:Error creating query 'datetime.datetime' object has no attribute 'between'
What can be the issue for this error?