I guess that connectionsis a lot for many in the user model. This means that it user.connectionsis an instance of a related manager. You should try passing the instance queryset, i.e.:
friends_you_may_know = list(wider_circle.exclude(user_id__in=user.connections.all()))
source
share