'Get the parent\'s key.
This method is useful for avoiding a potential fetch from the datastore
but still get information about the instances parent.
Returns:
Parent key of entity, None if there is no parent.'

def parent_key(self):

    if (self._parent_key is not None):
        return self._parent_key
    elif (self._parent is not None):
        return self._parent.key()
    elif (self._entity is not None):
        return self._entity.parent()
    elif (self._key is not None):
        return self._key.parent()
    else:
        return None
