Django check if object in ManyToMany field

Solution 1:

if user.partner_set.filter(slug=requested_slug).exists():
     # do some private stuff

Solution 2:

If we just need to know whether a user object is associated to a partner object, we could just do the following (as in this answer):

if user in partner.user.all():
    #do something