@require_role('admin')
def asset_del(request):
 asset_id = request.GET.get('id', '')
 if asset_id:
  Asset.objects.filter(id=asset_id).delete()
 if (request.method == 'POST'):
  asset_batch = request.GET.get('arg', '')
  asset_id_all = str(request.POST.get('asset_id_all', ''))
  if asset_batch:
   for asset_id in asset_id_all.split(','):
    asset = get_object(Asset, id=asset_id)
    asset.delete()
 return HttpResponse(u'\u5220\u9664\u6210\u529f')

@ require_role ( 'admin' ) def asset_del ( request ) : asset_id = request . GET . get ( 'id' , '' ) if asset_id : Asset . objects . filter ( id = asset_id ) . delete ( ) if ( request . method == 'POST' ) : asset_batch = request . GET . get ( 'arg' , '' ) asset_id_all = str ( request . POST . get ( 'asset_id_all' , '' ) ) if asset_batch : for asset_id in asset_id_all . split ( ',' ) : asset = get_object ( Asset , id = asset_id ) asset . delete ( ) return HttpResponse ( u'\u5220\u9664\u6210\u529f' )
del a asset .