def default(self, obj):
    if isinstance(obj, QuerySet):
        return serializers.serialize('python', obj, ensure_ascii=False)
return simplejson.JSONEncoder.default(self, obj)
Serializing objects containing django querysets