'Deprecated use :func:`Document.ensure_index`'

def ensure_index(self, **kwargs):

    msg = 'Doc.objects()._ensure_index()    is    deprecated.    Use    Doc.ensure_index()    instead.'
    warnings.warn(msg, DeprecationWarning)
    self._document.__class__.ensure_index(**kwargs)
    return self
