'Django list DB entries if LDAP group and key parameter match

Having hard time to figure out mechanism for my django app.

I have tabele in db with list of Agents and every agent has assigned specific name of LDAP group in this table.

Now i need to somehow compare LDAP group of logged user this LDAP value from agent table and list only those agents which matches LDAP group.

I know how to get LDAP group of user. Just need to figure out how to match this value with list of agents and list them.

End effect: User logging in and can list agents only which matches his LDAP group.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source