Opened 15 years ago
Closed 15 years ago
#11758 closed (invalid)
django.views.generic.list_detail doenst render object list
Reported by: | gekis13 | Owned by: | nobody |
---|---|---|---|
Component: | Core (Other) | Version: | dev |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Hello.
I'm doing http://docs.djangoproject.com/en/dev/intro/tutorial04/#intro-tutorial04 at
Django version 1.2 pre-alpha SVN-11474.
In step "Use generic views: Less code is better"
Django iso show Poll list tells: No polls are available.
In debug I saw that Context has Polls objects: Context.dict[4].object_list[0]=mysite.polls.model.Poll.
_resolve_lookup raise KeyError when try to get context[u"latest_poll_list"]. After that I see nothing.
Fix please:)
Stack trace from Wing IDE:
manage.py, line 11, in <module>
execute_manager(settings)
init.py, line 362, in execute_manager
utility.execute()
init.py, line 303, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
base.py, line 195, in run_from_argv
self.execute(*args, options.dict)
base.py, line 222, in execute
output = self.handle(*args, options)
runserver.py, line 84, in handle
inner_run()
runserver.py, line 60, in inner_run
run(addr, int(port), handler)
basehttp.py, line 698, in run
httpd.serve_forever()
SocketServer.py, line 226, in serve_forever
self._handle_request_noblock()
SocketServer.py, line 281, in _handle_request_noblock
self.process_request(request, client_address)
SocketServer.py, line 307, in process_request
self.finish_request(request, client_address)
SocketServer.py, line 320, in finish_request
self.RequestHandlerClass(request, client_address, self)
basehttp.py, line 560, in init
BaseHTTPRequestHandler.init(self, *args, kwargs)
SocketServer.py, line 615, in init
self.handle()
basehttp.py, line 605, in handle
handler.run(self.server.get_app())
basehttp.py, line 279, in run
self.result = application(self.environ, self.start_response)
basehttp.py, line 651, in call
return self.application(environ, start_response)
wsgi.py, line 241, in call
response = self.get_response(request)
base.py, line 92, in get_response
response = callback(request, *callback_args, callback_kwargs)
list_detail.py, line 101, in object_list
return HttpResponse(t.render(c), mimetype=mimetype)
init.py, line 178, in render
return self.nodelist.render(context)
init.py, line 779, in render
bits.append(self.render_node(node, context))
debug.py, line 71, in render_node
result = node.render(context)
defaulttags.py, line 239, in render
value = bool_expr.resolve(context, True)
init.py, line 546, in resolve
obj = self.var.resolve(context)
init.py, line 687, in resolve
value = self._resolve_lookup(context)
init.py, line 713, in _resolve_lookup
current = current[bit]
Thanks,
Grigory.
Im very sorry. Do not change the template: latest_poll_list to object_list.
Invalid.