Let's say I have this sqlmodel.SQLModel
which has a table name Project
.
My intention is to feature a record of a Project
for a definite period of time, e.g. 3 days, i.e. setting it's field featured
to be True
, and automatically set its field featured
to be False
thereafter.
class Project(SQLModel):
featured: bool = False
How can I achieve this behavior using FastAPI? Is it via background tasks or what?