I have three Django models that exist in a hierarchy:
Protocol -> has Tests
Test -> has Cases
The Test model has a foreign key to Protocol, and the Case model has foreign keys to Test and Protocol. A pretty simple structure.
Each of these models has an attribute called owner and any user in my app can own anything. What I want to do is create a query that gives me a unique set of all of the owners of any instance of these three models. I haven’t been able to find a nice way to do this in Django. Any help is appreciated.
You can’t do it without querying all the models individually.