https://docs.djangoproject.com/es/1.10/ref/signals/#post-delete
423215
def post_delete(sender, instance, using, **kwargs):
    """"""
    try:
        with transaction.atomic():
            if not should_audit(instance):
                return False

            object_json_repr = serializers.serialize("json", [instance])

            # user
            try:
                user = get_current_user()
                # validate that the user still exists
                user = get_user_model().objects.get(pk=user.pk)
            except:
                user = None

            if isinstance(user, AnonymousUser):
                user = None
            c_t = ContentType.objects.get_for_model(instance)
            sid = transaction.savepoint()
            try:
                with transaction.atomic():
                    # crud event
                    crud_event = CRUDEvent.objects.create(
                        event_type=CRUDEvent.DELETE,
                        object_repr=str(instance),
                        object_json_repr=object_json_repr,
                        content_type_id=c_t.id,
                        object_id=instance.pk,
                        user_id=getattr(user, 'id', None),
                        datetime=timezone.now(),
                        user_pk_as_string=str(user.pk) if user else user
                    )

            except Exception as e:
                logger.exception(
                    "easy audit had a pre-save exception on CRUDEvent creation. instance: {}, instance pk: {}".format(
                        instance, instance.pk))
                transaction.savepoint_rollback(sid)
    except Exception:
        logger.exception('easy audit had a post-delete exception.')
729219
def forum_post_undelete(self, post_id):
        
        return self._get('forum_posts/{0}/undelete.json'.format(post_id),
                         method='POST', auth=True)
498081
def delete_project(self, project_name):
        
        headers = {}
        params = {}
        resource = "/"

        (resp, header) = self._send("DELETE", project_name, None, resource, params, headers)
        return DeleteProjectResponse(header, resp)
210793
def postOptions(self):
        
        if self.portIdentifiers:
            store = self.parent.parent.getStore()
            store.transact(self._delete, store, self.portIdentifiers)
            print "Deleted."
            raise SystemExit(0)
        else:
            self.opt_help()
886169
def delete
      success = true
      tries ||= 3
      request = Net::HTTP::Delete.new("/api/projects/#{Connection.api_key}/terms/#{self.id}")
      WebTranslateIt::Util.add_fields(request)
      begin
        Util.handle_response(Connection.http_connection.request(request), true, true)
      rescue Timeout::Error
        puts "Request timeout. Will retry in 5 seconds."
        if (tries -= 1) > 0
          sleep(5)
          retry
        else
          success = false
        end
      end
      success
    end
271272
def delete(self, endpoint, json=None, params=None, **kwargs):
        
        json = kwargs['data'] if 'data' in kwargs else json
        return self._make_request('delete', endpoint, data=json, params=params)
296648
def delete(url)
      params = { url: url }
      options = create_params(params)
      result_code = self.class.get('/posts/delete', options).parsed_response["result"]["code"]

      raise Error.new(result_code) if result_code != "done"

      result_code
    end
418304
function do_delete(self, ObjType, obj) {
	return nr_fcall("nopg:do_delete", function() {
		if(!(obj && obj.$id)) { throw new TypeError("opts.$id invalid: " + util.inspect(obj) ); }
		var query, params;
		query = "DELETE FROM " + (ObjType.meta.table) + " WHERE id = $1";
		params = [obj.$id];
		return do_query(self, query, params);
	});
}
581065
def delete(callback=None, path=None, method=Method.DELETE, tags=None, summary="Delete specified resource.",
           middleware=None):
    # type: (Callable, Path, Methods, Tags, str, List[Any]) -> Operation
    
    def inner(c):
        op = Operation(c, path or PathParam('{key_field}'), method, None, tags, summary, middleware)
        op.responses.add(Response(HTTPStatus.NO_CONTENT, "{name} has been deleted.", None))
        op.responses.add(Response(HTTPStatus.NOT_FOUND, "Not found", Error))
        return op
    return inner(callback) if callback else inner
668551
def forum_post_delete(self, post_id):
        
        return self._get('forum_posts/{0}.json'.format(post_id),
                         method='DELETE', auth=True)
884746
def photo_post_delete_handler(sender, **kwargs):
    ''''''
    instance = kwargs.get('instance')
    instance.master.delete(save=False)
    instance.delete_all_renditions()
17959
def delete(self, *args, **kwargs):
        """"""
        self.before_delete(args, kwargs)

        self.delete_object(kwargs)

        result = {'meta': {'message': 'Object successfully deleted'}}

        final_result = self.after_delete(result)

        return final_result
508810
def community_post_delete(self, id, **kwargs):
        ""
        api_path = "/api/v2/community/posts/{id}.json"
        api_path = api_path.format(id=id)
        return self.call(api_path, method="DELETE", **kwargs)
283133
def submission_delete(self, submission_id):
        
        response = self._post(self.apiurl + '/v2/submission/delete', data={'apikey': self.apikey, 'submission_id': submission_id})

        return self._raise_or_extract(response)
334224
def delete_view(self, request, object_id, extra_context=None):
        ""
        queryset = self.model._default_manager.filter(pk=object_id)
        response = self.delete_selected(request, queryset)
        if response:
            return response
        url = reverse('admin:%s_%s_changelist' % (self.model._meta.app_label, self.model._meta.model_name))
        return HttpResponseRedirect(url)
170201
def base_definition_post_delete(sender, instance, **kwargs):
    
    if hasattr(instance._state, '_deletion'):
        # Make sure to flatten abstract bases since Django
        # migrations can't deal with them.
        model = popattr(instance._state, '_deletion')
        for field in instance.base._meta.fields:
            perform_ddl('remove_field', model, field)
712038
def post_delete_helper(form_tag=True):
    
    helper = FormHelper()
    helper.form_action = '.'
    helper.attrs = {'data_abide': ''}
    helper.form_tag = form_tag
    
    helper.layout = Layout(
        ButtonHolderPanel(
            Row(
                Column(
                    'confirm',
                    css_class='small-12 medium-8'
                ),
                Column(
                    Submit('submit', _('Submit')),
                    css_class='small-12 medium-4 text-right'
                ),
            ),
        ),
    )
    
    return helper