1👍
✅
You should filter on the name
of the account_types
, so:
User.objects.get(uuid=uuid, account_types__name='Mentor')
or if you want all User
objects that are a mentor, you can work with:
User.objects.filter(account_types__name='Mentor')
Source:stackexchange.com