7👍
✅
It looks like you’re using a dictionary not an object.
Try
potential_friends.append(Friendship.objects.friends_for_user(friend[‘friend’]))
Source:stackexchange.com