Q:

Django: int() argument must be a string , a bytes-like object or a number, not 'Game'

Here's my code,
objects = sorted(Game.objects.filter(...), key=lambda x: random.random())
items = Game.objects.exclude(pk__in=objects)

But, i'm getting this error,

int() argument must be a string, a bytes-like object or a number, not
  'Game'

How can I fix this problem? 

A:

As Arpit suggests, you need to add the pk value.  You could also modify the items variable like this
items = Game.objects.exclude(pk__in=[o.pk for o in objects])

Compared to Arpit's solution this won't throw a list index out of range. 