'Descriptor for instantiating a new QuerySet object when
Document.objects is accessed.'

def __get__(self, instance, owner):

    if (instance is not None):
        return self
    queryset_class = owner._meta.get('queryset_class', self.default)
    queryset = queryset_class(owner, owner._get_collection())
    if self.get_queryset:
        arg_count = self.get_queryset.func_code.co_argcount
        if (arg_count == 1):
            queryset = self.get_queryset(queryset)
        elif (arg_count == 2):
            queryset = self.get_queryset(owner, queryset)
        else:
            queryset = partial(self.get_queryset, owner, queryset)
    return queryset
