'Used by :meth:`~mongoengine.Document.reload` to ensure the
correct instance is linked to self.'

def _reload(self, key, value):

    if isinstance(value, BaseDict):
        value = [(k, self._reload(k, v)) for (k, v) in value.items()]
        value = BaseDict(value, self, key)
    elif isinstance(value, EmbeddedDocumentList):
        value = [self._reload(key, v) for v in value]
        value = EmbeddedDocumentList(value, self, key)
    elif isinstance(value, BaseList):
        value = [self._reload(key, v) for v in value]
        value = BaseList(value, self, key)
    elif isinstance(value, (EmbeddedDocument, DynamicEmbeddedDocument)):
        value._instance = None
        value._changed_fields = []
    return value
