I know you can build dynamic filters for queries for SQLAlchemy by supplying **kwargs
to filter_by
.
For example
filters = {'id': '123456', 'amount': '232'}
db.session.query(Transaction).filter_by(**filters)
Below is my question:
What if I need to query by "greater than" or "less than" clauses? For example (raw SQL):
select * from transaction t
where t.amount > 10 and t.amount < 100;