PyBossa/pybossa — comment on commit 9d2a0869f732978065b5d81e295ed49339709f37
File:  line 0
By teleyinex:

The test unit test the case where there is no TaskRun in the DB and it is working so far :), so I do not fully understand you, sorry.

The starting point for every application will be a DB with some tasks but with no TaskRuns at all. Thus, the newtask should provide one task at least, even though there is no TaskRun.

When you ask about left outer join, do you mean this?

from sqlalchemy.orm import joinedload
q = Session.query(Task).options(joinedload(Task.task_runs)).filter(Task.app_id == app_id)