Again, I would leverage backrefs:

```
source = Source.query.filter(Source.filesystem_id == sid).one() # or get_one_or_else
docs = [ submission.filename for submission in source.submissions if not submission.downloaded ]
```