The code uses the django ORM which is sync, and fastapi handles sync paths just fine. So having all of this extra code for handling async was unnecessary.
Both cached_property and Literal were introduced in Python 3.8 so they can't be used.