Hello @kartik,
You can get the list of Users that are friends with a given user through:
friends = User.objects.filter(friendship_creator_set__friend=request.user)
or if you want to obtain the Users that request.user considers friends (so the relation in reverse), you can use:
friends = User.objects.filter(friend_set__user=request.user)
These are the User objects. We can also obtain the Friend objects, with:
friends = Friend.objects.filter(friend=request.user)
or we can obtain the user names with:
usernames = User.objects.filter(
friendship_creator_set__friend=request.user
).value_list('username', flat=True)
Hope this works!!