def detail(request,hero_id):
hero=models.HeroInfo.objects.get(id=hero_id)
return render_to_response('detail.html',{'detail_obj':hero})

原因为视图获取参数时候   写成了(id,hero_id),改成如上的(id=hero_id)即可解决。

 

Django报:builtin_function_or_method' object is not iterable的更多相关文章

  1. DJANGO问题--Error: ‘ManyRelatedManager’ object is not iterable

    http://www.itblah.com/django-error-manyrelatedmanager-object-iterable/ Django: Error: ‘ManyRelatedMa ...

  2. for遍历用例数据时,报错:TypeError: list indices must be integers, not dict,'int' object is not iterable解决方法

    一:报错:TypeError: list indices must be integers, not dict for i in range(0,len(test_data)): suite.addT ...

  3. python报错Nonetype object is not iterable

    https://www.cnblogs.com/zhaijiahui/p/8391701.html 参考链接:http://blog.csdn.net/dataspark/article/detail ...

  4. 'ManyRelatedManager' object is not iterable

    先看下面的代码: class Worker(models.Model): departments = moels.ManyToManyField(Department, verbose_name=u& ...

  5. Python问题:'Nonetype' object is not iterable

    参考链接:http://blog.csdn.net/dataspark/article/details/9953225 [解析] 这个错误提示一般发生在将None赋给多个值时. [案例] 定义了如下的 ...

  6. 'WebElement' object is not iterable

    checkbox.html源码: <html> <head> <meta http-equiv="content-type" content=&quo ...

  7. TypeError: 'ExcelData' object is not iterable

    今天写了个测试的代码,结果在执行test_register.py文件在调用readexcle.py的时候一直报错TypeError: 'ExcelData' object is not iterabl ...

  8. python TypeError: 'NoneType' object is not iterable

    list(set(map(lambda tp_id : tp_id if not ('#' in tp_id) and len(tp_id.strip().replace('\n', '')) > ...

  9. TypeError: 'TestCase' object is not iterable

    这个异常呢其实是因为我对list没有足够熟悉 我一开始很疑惑,明明已经正确返回testcase对象了呀,为啥会报TypeError: 'TestCase' object is not iterable ...

随机推荐

  1. Python pip install Twisted 出错“Command "c:\python37\python.exe -u -c "import setuptools, tokenize;__file__='C:...\\Twisted\\setup.py'.... failed with error code 1 in C:... \\Twisted"

    如标题所说: python版本是目前最新的3.7.1 结果发现并不是环境问题,而是直接 pip install Twisted 安装的包不兼容 需要手动下载兼容的扩展包Twisted-18.9.0-c ...

  2. 牛散NO.3:MACD放之四海 假作真时真亦假

    大宗商品日线“异曲同工夺命勾魂枪” 话说有实战意义的技术在任何资本市场里都能产生出神奇的效果.不能说放之四海皆准,但至少起到触类旁通的“牵强”吧.大宗商品特别是在国际市场交易的大宗 商品由于是来自各方 ...

  3. 使用Google Https搜索

    一. 将浏览器Google的默认搜索使用https 1. IE浏览器 进入注册表搜索"google.com"将搜索替换成https://www.google.com.hk 2. F ...

  4. svn Couldn't open rep-cache database

    出现这样的错误原因是因为 问题一 开始出现错误:The database disk image is malformed 解决方案:http://www.cnblogs.com/chen110xi/p ...

  5. Atitit.atiDataStoreService   v2 新特性

    Atitit.atiDataStoreService   v2 新特性 1.1. V1  基础实现1 1.2. V2  增加了对  $uuid  $cur_uid参数的支持1 1.3. 增加了fld  ...

  6. grub.conf文件说明

    default=0 timeout=5 splashimage=(hd0,0)/grub/splash.xpm.gz hiddenmenu title Red Hat Enterprise Linux ...

  7. MySQL的索引(中)

    连着发了几天文章,从我收到的反映来说,大家觉着还不错,可以很清晰的看到知识的脉络,但是这个还不错是针对传统的文章的无聊.不明确.完全不考虑考虑用户体验的角度上对比出来的.掌握一门知识还是不容易的,有的 ...

  8. Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed

    错误原因:常量.随机或者依赖时区的表达式不能作为分区函数. 解决方法:把ts列换成datetime类型,创建成功. CREATE TABLE T_log( id INT(11) NOT NULL AU ...

  9. centos 源码安装apache 之apr、apr-util

    apr 和 apr-util官网下载地址: http://apr.apache.org/download.cgi 安装顺序是先安装apr然后再安装 apr-util,因为安装apr-util需要apr ...

  10. scp -P 非22端口拷贝

    scp 远程拷贝非22端口的服务器文件的方法:上传文件到服务器scp -P 29966 /Users/ianMac/Desktop/progit.zh.pdf root@远程ssh服务器的ip:/ho ...