def find_field_meta(obj, value):
    """
    In a model, finds the attribute meta connected to the last object when
    a chain of  connected objects is given in a string separated with double
    underscores.
    """
    if "__" in value:
        value_list = value.split("__")
        child_obj = obj._meta.get_field(value_list[0]).rel.to
        return find_field_meta(child_obj, "__".join(value_list[1:]))
    return obj._meta.get_field(value)
In a model, finds the attribute meta connected to the last object when
    a chain of  connected objects is given in a string separated with double
    underscores.