I have seen this question: The model has two many-to-many relations through the intermediate model
But I think my problem is slightly different:
class