def METHOD_NAME(obj, pk) -> str:
    """
    Returns the admin URL for the given Django model instance or class with
    the given primary key.
    """
    # https://stackoverflow.com/a/10420949
    info = (obj._meta.app_label, obj._meta.model_name)
    return reverse("admin:%s_%s_change" % info, args=(pk,))