def METHOD_NAME(self, obj):
    if obj.action_flag == DELETION:
        link = escape(obj.object_repr)
    else:
        ct = obj.content_type
        link = '<a href="%s">%s</a>' % (
            reverse('admin:%s_%s_change' % (ct.app_label, ct.model), args=[obj.object_id]),
            escape(obj.object_repr),
        )
    return mark_safe(link)