[Fixed]-Models referring to each other – how can I most efficiently fix this issue?

2👍

You can use the reverse ForeignKey relation on each Company to access their respective Users:

def list_admins(self):
    return self.user_set.filter(is_admin=True)

Doc. reference: Following relationships “backward”

-1👍

def list_admins(self):
    return User.object.filter(company__is_admin=True);
👤Diego

Leave a comment