parameters: (request)
return_statement: return my_render('jasset/asset_detail.html', locals(), request)
docstring: Asset detail view
docstring_summary: Asset detail view
docstring_tokens: Asset detail view
function: def asset_detail(request):
      """
      Asset detail view
      """
      header_title, path1, path2 = u'主机详细信息', u'资产管理', u'主机详情'
      asset_id = request.GET.get('id', '')
      asset = get_object(Asset, id=asset_id)
      perm_info = get_group_asset_perm(asset)
      log = Log.objects.filter(host=asset.hostname)
      if perm_info:
          user_perm = []
          for perm, value in perm_info.items():
              if perm == 'user':
                  for user, role_dic in value.items():
                      user_perm.append([user, role_dic.get('role', '')])
              elif perm == 'user_group' or perm == 'rule':
                  user_group_perm = value
      print perm_info
  
      asset_record = AssetRecord.objects.filter(asset=asset).order_by('-alert_time')
  
      return my_render('jasset/asset_detail.html', locals(), request)
function_tokens: def asset_detail ( request ) : header_title , path1 , path2 = u'主机详细信息', u'资产管理', u ' 机详情' asset_id = request . GET . get ( 'id' , '' ) asset = get_object ( Asset , id = asset_id ) perm_info = get_group_asset_perm ( asset ) log = Log . objects . filter ( host = asset . hostname ) if perm_info : user_perm = [ ] for perm , value in perm_info . items ( ) : if perm == 'user' : for user , role_dic in value . items ( ) : user_perm . append ( [ user , role_dic . get ( 'role' , '' ) ] ) elif perm == 'user_group' or perm == 'rule' : user_group_perm = value print perm_info asset_record = AssetRecord . objects . filter ( asset = asset ) . order_by ( '-alert_time' ) return my_render ( 'jasset/asset_detail.html' , locals ( ) , request )