Django报:builtin_function_or_method' object is not iterable
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的更多相关文章
- DJANGO问题--Error: ‘ManyRelatedManager’ object is not iterable
http://www.itblah.com/django-error-manyrelatedmanager-object-iterable/ Django: Error: ‘ManyRelatedMa ...
- 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 ...
- python报错Nonetype object is not iterable
https://www.cnblogs.com/zhaijiahui/p/8391701.html 参考链接:http://blog.csdn.net/dataspark/article/detail ...
- 'ManyRelatedManager' object is not iterable
先看下面的代码: class Worker(models.Model): departments = moels.ManyToManyField(Department, verbose_name=u& ...
- Python问题:'Nonetype' object is not iterable
参考链接:http://blog.csdn.net/dataspark/article/details/9953225 [解析] 这个错误提示一般发生在将None赋给多个值时. [案例] 定义了如下的 ...
- 'WebElement' object is not iterable
checkbox.html源码: <html> <head> <meta http-equiv="content-type" content=&quo ...
- TypeError: 'ExcelData' object is not iterable
今天写了个测试的代码,结果在执行test_register.py文件在调用readexcle.py的时候一直报错TypeError: 'ExcelData' object is not iterabl ...
- 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', '')) > ...
- TypeError: 'TestCase' object is not iterable
这个异常呢其实是因为我对list没有足够熟悉 我一开始很疑惑,明明已经正确返回testcase对象了呀,为啥会报TypeError: 'TestCase' object is not iterable ...
随机推荐
- Docker 安装docker-compose多容器管理服务
原文地址:https://github.com/eacdy/spring-cloud-book/blob/master/3%20%E4%BD%BF%E7%94%A8Docker%E6%9E%84%E5 ...
- curl Error : maximum redirects followed , 这种问题的一种原因 .
在stack overflow 上查找到有些网站上需要返回一些cookie的,所以当我们curl当相应的网站时,必须要将返回的cookie保存起来. $cookie = tempnam (" ...
- 电脑端的全能扫描王:图片转文字识别、识别pdf、图片中的文字,图片提取txt
手机中有全能扫描王,但PC端没有.所以需要另外找. 发现微软的oneNode有提供类似的功能. 第一步.下载Microsoft OneNode http://www.onenote.com/downl ...
- centos 7.x systemctl 几个常用的操作
# 开机启动 systemctl enable nginx # 禁止开机启动 systemctl disable nginx # 开启服务 systemctl start nginx # 停止服务 s ...
- Webpack 的 HtmlWebpackPlugin 如何控制某个 chunks 的 inject 位置?
https://segmentfault.com/q/1010000006591131 通过修改 HtmlWebpackPlugin 源码实现了 修改后的配置: new HtmlWebpackPlug ...
- Django中ORM介绍和字段参数
Object Relational Mapping(ORM) ORM介绍 ORM概念 对象关系映射(Object Relational Mapping,简称ORM)模式是一种为了解决面向对象与关系数据 ...
- unity3d 动画卡帧 动画合成 动画层次
2013-02-26 16:22 2059人阅读 评论(0) 收藏 举报 unity3d 中动画的添加 http://unity3d.com/support/documentation/Manua ...
- 一起talk C栗子吧(第八十七回:C语言实例--使用管道进行进程间通信概述)
各位看官们,大家好.上一回中咱们说的是进程间通信的样例.这一回咱们说的样例是:使用管道进行进程间通信. 闲话休提,言归正转. 让我们一起talk C栗子吧! 我们在前面的的章回中介绍了使用管道进行进程 ...
- configure: error : no acceptable C compiler found in $PATH
先要用yum install yum-fastestmirror更新下源 # yum -y install gcc
- IRQ与FIQ的区别
1.对FIQ你必须进快处理中断请求,并离开这个模式. 2.IRQ可以被FIQ所中断,但FIQ不能被IRQ所中断,在处理FIQ时必须要关闭中断. 3.FIQ的优先级比IRQ高. 4.FIQ模式下,比IR ...