def METHOD_NAME(request, id, template_name="entities/delete.html"):
    entity = get_object_or_404(Entity, pk=id)
    if has_perm(request.user,'entities.delete_entity'):
        if request.method == "POST":
            messages.add_message(request, messages.SUCCESS, _('Successfully deleted %(e)s' % { 'e' : entity }))
            entity.METHOD_NAME()
            return HttpResponseRedirect(reverse('entity.search'))
        return render_to_resp(request=request, template_name=template_name,
            context={'entity': entity})
    else:
        raise Http403