@treeio_login_required
@handle_response_format
def object_delete(request, object_id, response_format='html'):
 object = get_object_or_404(Object, pk=object_id)
 if (not request.user.profile.has_permission(object, mode='w')):
  return user_denied(request, message="You don't have access to this Object")
 if request.POST:
  if ('delete' in request.POST):
   object.delete()
   return HttpResponseRedirect(reverse('core_trash'))
  elif ('cancel' in request.POST):
   return HttpResponseRedirect(reverse('core_trash'))
 return render_to_response('core/trash/object_delete', {'object': object}, context_instance=RequestContext(request), response_format=response_format)

@ treeio_login_required @ handle_response_format def object_delete ( request , object_id , response_format = 'html' ) : object = get_object_or_404 ( Object , pk = object_id ) if ( not request . user . profile . has_permission ( object , mode = 'w' ) ) : return user_denied ( request , message = "You don't have access to this Object" ) if request . POST : if ( 'delete' in request . POST ) : object . delete ( ) return HttpResponseRedirect ( reverse ( 'core_trash' ) ) elif ( 'cancel' in request . POST ) : return HttpResponseRedirect ( reverse ( 'core_trash' ) ) return render_to_response ( 'core/trash/object_delete' , { 'object' : object } , context_instance = RequestContext ( request ) , response_format = response_format )
completely delete item .