If you leverage backrefs, you should be able to get all this for free from the ORM, e.g.

```
source = get_source(source_id)
if source.star.starred:
    ...
```