@staff_member_required
def update_issue(request, pk, mode=None, action=None):
 issue = Issue.obj.get(pk=pk)
 if (mode == 'delete'):
  issue.delete()
  return redir('admin:issues_issue_changelist')
 else:
  if (mode == 'progress'):
   val = int(action)
  else:
   val = bool((action == 'on'))
  setattr(issue, mode, val)
  issue.save()
  return HttpResponse('')

@ staff_member_required def update_issue ( request , pk , mode = None , action = None ) : issue = Issue . obj . get ( pk = pk ) if ( mode == 'delete' ) : issue . delete ( ) return redir ( 'admin:issues_issue_changelist' ) else : if ( mode == 'progress' ) : val = int ( action ) else : val = bool ( ( action == 'on' ) ) setattr ( issue , mode , val ) issue . save ( ) return HttpResponse ( '' )
ajax view .