using lateral join from a subquery in sqlalchemy
I have 2 tables (defined as models in python): Productions and Tasks
A Production can contain 1 or more Tasks.
Tasks have a name (string), a priority value (int) and a state (TODO / ACTIVE / COMPLETE).
I need to find all productions with an ActiveTask of a specific name.