Generic detail view DetailView must be called with either an object pk or a slug.
来源:互联网 发布:陈都灵演技知乎 编辑:程序博客网 时间:2024/05/16 13:05
解决办法
url(r'^(?P<poll_id>\d+)/$',-$ url(r'^(?P<poll_id>\d+)/results/$',-$
This is the correct core:
url(r'^(?P<pk>\d+)/$',-$ url(r'^(?P<pk>\d+)/results/$',-$
把URL捕获的组名称改为pk
参照:
http://stackoverflow.com/questions/12304050/django-tutorial-generic-views-attribute-error
0 0
- Generic detail view DetailView must be called with either an object pk or a slug.
- A context path must either be an empty string or start with a '/' and do not end with a '/' 问题解决方法
- yii Column name must be either a string or an array.
- Name of an object member must be a string
- A ref or out argument must be an assignable variable
- ValueError: cannot index a corpus with zero features (you must specify either `num_features` or a no
- Uncaught TypeError: Super expression must either be null or a function, not undefine
- Uncaught (in promise) TypeError: Super expression must either be null or a function
- React Native报Super expression error must either be null or a function错误分析
- Synthesized property 'xx' must either be named the same as a compatible ivar or must explicitly name
- TypeError: unbound method a() must be called with A instance as first argument (got nothing instead)
- render() must be called with a dict, not a Context. return HttpResponse(t.render(c))解决
- Function importPackage must be called with a package; had "[JavaClass java.util.ArrayList]"
- Function importPackage must be called with a package; had "[JavaClass java.util.ArrayList]"
- Xcode编译错误:Synthesized property 'xxxXXX' must either be named the same as a compatible ivar or mus
- Xcode编译错误:Synthesized property 'xxxXXX' must either be named the same as a compatible ivar or mus
- 【原】React Native踩坑系列之-Super expression must either be null or a function, not undefined
- ERROR Error: If ngModel is used within a form tag, either the name attribute must be set or the form
- Roman to Integer
- Ubuntu下AllJoyn源码编译方法
- 在vi中如何删除一行,复制多行,查找字符?
- Linux设备驱动程序学习(5)-高级字符驱动程序操作[(2)阻塞型I/O和休眠]
- STM32之CAN--CAN ID过滤器分析
- Generic detail view DetailView must be called with either an object pk or a slug.
- ArcGlobe三维开发之三——3D符号的现实单位显示
- Linux设备驱动程序学习(6)-高级字符驱动程序操作[(3)设备文件的访问控制]
- 一键快速搭建lamp
- poj 1679
- Android下常见的内存泄漏
- qt线程(转)----这篇很专业!
- Linux设备驱动程序学习(6)-高级字符驱动程序操作[(4)异步通知fasync]
- xampp快速配置虚拟主机