@one_perm_required_or_403(pr_resource_delete,
                          (Project, "slug__exact", "project_slug"))
def resource_delete(request, project_slug, resource_slug):
    resource = get_object_or_404(Resource, project__slug = project_slug,
                                 slug = resource_slug)
    if request.method == 'POST':
        xhr = request.GET.has_key('xhr')

        import copy
        resource_ = copy.copy(resource)
        resource.delete()

        post_resource_delete.send(sender=None, instance=resource_,
            user=request.user)

        # Signal for logging
        messages.success(request,
            _("The translation resource '%s' was deleted.") % resource_.name)

        if xhr:
            response_dict = {'status': 200}
            return HttpResponse(simplejson.dumps(response_dict), mimetype='application/javascript')

        return HttpResponseRedirect(reverse('project_detail',
                                    args=[resource.project.slug]),)
    else:
        return render_to_response(
            'resources/resource_confirm_delete.html', {'resource': resource,},
            context_instance=RequestContext(request))
Delete a Translation Resource in a specific project.
dataset/ETHPy150Open rvanlaar/easy-transifex/src/transifex/transifex/resources/views.py/resource_delete