how to invert a query filter in django code example Example: django reverse queryset queryset = reversed(Collection.objects.filter(pk__in = li))