@handle_response_format
@treeio_login_required
@module_admin_required()
def page_delete(request, page_id, response_format='html'):
 page = get_object_or_404(Page, pk=page_id)
 if request.POST:
  if ('delete' in request.POST):
   page.delete()
   return HttpResponseRedirect(reverse('core_admin_index_pages'))
  elif ('cancel' in request.POST):
   return HttpResponseRedirect(reverse('core_admin_page_view', args=[page.id]))
 return render_to_response('core/administration/page_delete', {'page': page}, context_instance=RequestContext(request), response_format=response_format)

@ handle_response_format @ treeio_login_required @ module_admin_required ( ) def page_delete ( request , page_id , response_format = 'html' ) : page = get_object_or_404 ( Page , pk = page_id ) if request . POST : if ( 'delete' in request . POST ) : page . delete ( ) return HttpResponseRedirect ( reverse ( 'core_admin_index_pages' ) ) elif ( 'cancel' in request . POST ) : return HttpResponseRedirect ( reverse ( 'core_admin_page_view' , args = [ page . id ] ) ) return render_to_response ( 'core/administration/page_delete' , { 'page' : page } , context_instance = RequestContext ( request ) , response_format = response_format )
static page delete .