def get_parent_language_code(parent_object):
    if parent_object is None:
        return None

    try:
        # django-parler uses this attribute
        return parent_object.get_current_language()
    except AttributeError:
        pass

    try:
        # E.g. ContentItem.language_code
        return parent_object.language_code
    except AttributeError:
        pass

    return None
.. versionadded:: 1.0
dataset/ETHPy150Open edoburu/django-fluent-contents/fluent_contents/models/managers.py/get_parent_language_code