def resolve_orm_path(model, orm_path):

    bits = orm_path.split('__')
    endpoint_model = reduce(get_model_at_related_field, [model] + bits[:-1])
    if bits[-1] == 'pk':
        field = endpoint_model._meta.pk
    else:
        field, _, _, _ = endpoint_model._meta.get_field_by_name(bits[-1])
    return field
This tricky method needs for tox tests. Otherwise it raises an
dataset/ETHPy150Open pivotal-energy-solutions/django-datatable-view/datatableview/utils.py/resolve_orm_path--crossover with--dataset/ETHPy150Open prawn-cake/vk-requests/vk_requests/auth.py/BaseAuthAPI.__repr__