How to check if value is in manytomany field? I am trying to do something like this:
if value in object1.followers:
    #BLA BLA BLA
But 'ManyRelatedManager' is not iterable. So what is correct way to do it?
You forgot the all():
if value in object1.followers.all():
    ...
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With