Get the base name of the admin route for a model or model instance.

    For use with :func:`django.urls.reverse`, although it still needs the specific route suffix
    appended, for example ``_changelist``.

def _get_admin_route_name(model_or_instance):
    """
    Get the base name of the admin route for a model or model instance.

    For use with :func:`django.urls.reverse`, although it still needs the specific route suffix
    appended, for example ``_changelist``.
    """
    model = model_or_instance if isinstance(model_or_instance, type) else type(model_or_instance)
    return 'admin:{meta.app_label}_{meta.model_name}'.format(meta=model._meta)