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. java之this关键字

    this使用范围 1.在类的方法定义中使用的this关键字代表调用该方法对象的引用. 2.当必须指出当前使用方法的对象是谁时,要使用关键字this. 3.有时使用this可以处理方法中成员变量和参数重 ...

  2. C#创建一个Window服务

    Window服务介绍 Microsoft Windows 服务能够创建在它们自己的 Windows 会话中可长时间运行的可执行应用程序.这些服务可以在计算机启动时自动启动,可以暂停和重新启动而且不显示 ...

  3. .net面试中的一些常见问题与答案

    1.页面传值的方式及其优缺点?   Session,Application,Cookies,Requst.QueryString,Requst.Form,Server.Transfer(通过Conte ...

  4. ViewStub 的使用

    一.内容概述 举例说明ViewStub标签的使用 二.ViewStub类的文档说明及应用场举例 文档描述: A ViewStub is an invisible, zero-sized View th ...

  5. Hive 正则匹配函数

    正则匹配字符解释: ^ 表示开头 $ 表示结尾 . 表示任意字符 * 表示任意多个 regexp_extract函数 语法:    regexp_extract(string subject,  st ...

  6. Nginx负载均衡和LVS负载均衡的比较分析(转)

    Nginx负载均衡和LVS负载均衡的比较分析 作者:匿名 来源:ChinaZ源码报导 浏览:1032次 2011-12-6 15:12:27 字号:大 中 小 [摘要]Nginx是一个高性能的 HTT ...

  7. js Json操作

    JSON字符串: var jsonStr='{"fname":"json","fage":1}' JSON对象:    var jsonOb ...

  8. Ireport常用操作汇总

    1.四则运算 new java.lang.Double(($F{fincome}.doubleValue())/($F{fhomePopulation}.intValue()))

  9. 14. First Position of Target 【easy】

    14. First Position of Target [easy] For a given sorted array (ascending order) and a targetnumber, f ...

  10. HTTP解读

    使用Telnet工具访问web资源 Windows中没有telnet这一工具,下面在Linux下演示: telnet www.baidu.com 80 Trying 61.135.169.125... ...