[Answered ]-Best way to search with a ManyToMany field Django

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')

Leave a comment