[PD-636] Remove duplicates caused by sorting by Activity

Basically foreign keys + order_by + distinct = fail. This addresses that by using annotations. I may be able to just annotate everything instead of just when sorting by activity, but this seems to work.