S
S
Sazoks2021-06-08 16:36:42
ORM
Sazoks, 2021-06-08 16:36:42

How to filter by custom condition (SQLAlchemy ORM)?

Good day!
I am rewriting my application, namely the interaction with the database, from raw SQL queries in my class to SQLAlchemy ORM.

Faced such problem:
1) There is a table events where there is a column run_date: datetime.
2) You need to select all events from the table where (run_date - datetime.now()).days < 1.

I'm new to Alchemy, so I'm asking here. How can I implement this selection through ORM?

Thanks in advance!

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question