[英]Does not exist. No exception supplied error
I have the following class based view. 我有以下基于类的视图。
class AllPluginsView(ListView):
queryset = get_models(get_app('plugins'))
template_name="console/plugins/plugins.html"
context_object_name = "objects"
And following template, 接下来的模板
{% for object in objects %}
<tr>
{% if object %}
<td>{{ object }}</td>
{% endif %}
</tr>
{% endfor %}
When I ask for the page, i get DoesNotExist at /path/to/plugins No exception supplied.
当我请求该页面时,我DoesNotExist at /path/to/plugins No exception supplied.
获取了DoesNotExist at /path/to/plugins No exception supplied.
error. 错误。 Any ideas ? 有任何想法吗 ?
urlpatterns = patterns('',
url(r'^$', AllPluginsView.as_view(),name='all-plugins'),
)
Perhaps it's an import order thing? 也许是进口订单? Try using get_queryset
instead. 尝试改用get_queryset
。
class AllPluginsView(ListView):
template_name="console/plugins/plugins.html"
context_object_name = "objects"
def get_queryset(self):
return get_models(get_app('plugins'))
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.