When calling
http://127.0.0.1:5000/about/someimage/image/span3
http://127.0.0.1:5000/about/someimage/image
but not:
http://127.0.0.1:5000/about/someimage/image/span3/download
I get a stack trace on the command line below. In the browser the image is rendered OK.
`ERROR:waitress:Exception when serving /favicon.ico
Traceback (most recent call last):
File "/Users/mjm/Dropbox/Devel/_Experiments/pyramid/kottitest/venv2/lib/python2.7/site-packages/waitress/channel.py", line 336, in service
task.service()
File "/Users/mjm/Dropbox/Devel/_Experiments/pyramid/kottitest/venv2/lib/python2.7/site-packages/waitress/task.py", line 169, in service
self.execute()
File "/Users/mjm/Dropbox/Devel/_Experiments/pyramid/kottitest/venv2/lib/python2.7/site-packages/waitress/task.py", line 388, in execute
app_iter = self.channel.server.application(env, start_response)
File "/Users/mjm/Dropbox/Devel/_Experiments/pyramid/kottitest/venv2/lib/python2.7/site-packages/fanstatic/publisher.py", line 224, in call
return self.app(environ, start_response)
File "/Users/mjm/Dropbox/Devel/_Experiments/pyramid/kottitest/venv2/lib/python2.7/site-packages/fanstatic/injector.py", line 64, in call
response = request.get_response(self.app)
File "/Users/mjm/Dropbox/Devel/_Experiments/pyramid/kottitest/venv2/lib/python2.7/site-packages/webob/request.py", line 1299, in send
application, catch_exc_info=False)
File "/Users/mjm/Dropbox/Devel/_Experiments/pyramid/kottitest/venv2/lib/python2.7/site-packages/webob/request.py", line 1263, in call_application
app_iter = application(self.environ, start_response)
File "/Users/mjm/Dropbox/Devel/_Experiments/pyramid/kottitest/venv2/lib/python2.7/site-packages/pyramid/router.py", line 223, in call
response = self.invoke_subrequest(request, use_tweens=True)
File "/Users/mjm/Dropbox/Devel/_Experiments/pyramid/kottitest/venv2/lib/python2.7/site-packages/pyramid/router.py", line 198, in invoke_subrequest
response = handle_request(request)
File "/Users/mjm/Dropbox/Devel/_Experiments/pyramid/kottitest/venv2/lib/python2.7/site-packages/kotti/filedepot.py", line 516, in call
response = self.handler(request)
File "/Users/mjm/Dropbox/Devel/_Experiments/pyramid/kottitest/venv2/lib/python2.7/site-packages/pyramid/tweens.py", line 48, in excview_tween
request_iface=request_iface.combined
File "/Users/mjm/Dropbox/Devel/_Experiments/pyramid/kottitest/venv2/lib/python2.7/site-packages/pyramid/view.py", line 541, in _call_view
response = view_callable(context, request)
File "/Users/mjm/Dropbox/Devel/_Experiments/pyramid/kottitest/venv2/lib/python2.7/site-packages/pyramid/config/views.py", line 377, in rendered_view
context)
File "/Users/mjm/Dropbox/Devel/_Experiments/pyramid/kottitest/venv2/lib/python2.7/site-packages/pyramid/renderers.py", line 450, in render_view
return self.render_to_response(response, system, request=request)
File "/Users/mjm/Dropbox/Devel/_Experiments/pyramid/kottitest/venv2/lib/python2.7/site-packages/pyramid/renderers.py", line 473, in render_to_response
result = self.render(value, system_values, request=request)
File "/Users/mjm/Dropbox/Devel/_Experiments/pyramid/kottitest/venv2/lib/python2.7/site-packages/pyramid/renderers.py", line 469, in render
result = renderer(value, system_values)
File "/Users/mjm/Dropbox/Devel/_Experiments/pyramid/kottitest/venv2/lib/python2.7/site-packages/pyramid_chameleon/zpt.py", line 47, in call
result = self.template(**system)
File "/Users/mjm/Dropbox/Devel/_Experiments/pyramid/kottitest/venv2/lib/python2.7/site-packages/chameleon/template.py", line 124, in call
return self.render(**kwargs)
File "/Users/mjm/Dropbox/Devel/_Experiments/pyramid/kottitest/venv2/lib/python2.7/site-packages/chameleon/zpt/template.py", line 261, in render
return super(PageTemplate, self).render(**vars)
File "/Users/mjm/Dropbox/Devel/_Experiments/pyramid/kottitest/venv2/lib/python2.7/site-packages/chameleon/template.py", line 171, in render
self._render(stream, econtext, rcontext)
File "notfound_b85d0ff58ef763f7807ad24b0b95b1df.py", line 143, in render
File "master_a1bc65c60d366662aead22dd761fe462.py", line 419, in render_main
File "/Users/mjm/Dropbox/Devel/_Experiments/pyramid/kottitest/venv2/lib/python2.7/site-packages/kotti/views/util.py", line 290, in render_template
return TemplateStructure(render(renderer, kwargs, self.request))
File "/Users/mjm/Dropbox/Devel/_Experiments/pyramid/kottitest/venv2/lib/python2.7/site-packages/pyramid/renderers.py", line 81, in render
result = helper.render(value, None, request=request)
File "/Users/mjm/Dropbox/Devel/_Experiments/pyramid/kottitest/venv2/lib/python2.7/site-packages/pyramid/renderers.py", line 469, in render
result = renderer(value, system_values)
File "/Users/mjm/Dropbox/Devel/_Experiments/pyramid/kottitest/venv2/lib/python2.7/site-packages/pyramid_chameleon/zpt.py", line 47, in call
result = self.template(**system)
File "/Users/mjm/Dropbox/Devel/_Experiments/pyramid/kottitest/venv2/lib/python2.7/site-packages/chameleon/template.py", line 124, in call
return self.render(**kwargs)
File "/Users/mjm/Dropbox/Devel/_Experiments/pyramid/kottitest/venv2/lib/python2.7/site-packages/chameleon/zpt/template.py", line 261, in render
return super(PageTemplate, self).render(**vars)
File "/Users/mjm/Dropbox/Devel/_Experiments/pyramid/kottitest/venv2/lib/python2.7/site-packages/chameleon/template.py", line 191, in render
raise_with_traceback(exc, tb)
File "/Users/mjm/Dropbox/Devel/_Experiments/pyramid/kottitest/venv2/lib/python2.7/site-packages/chameleon/template.py", line 171, in render
self._render(stream, econtext, rcontext)
File "nav_f2b663248fe3b93f5ca25bca8de072f3.py", line 302, in render
File "/Users/mjm/Dropbox/Devel/_Experiments/pyramid/kottitest/venv2/lib/python2.7/site-packages/pyramid/location.py", line 27, in inside
resource1 = resource1.parent
File "/Users/mjm/Dropbox/Devel/_Experiments/pyramid/kottitest/venv2/lib/python2.7/site-packages/kotti/resources.py", line 290, in parent
return self.parent
File "/Users/mjm/Dropbox/Devel/Experiments/pyramid/kottitest/venv2/lib/python2.7/site-packages/sqlalchemy/orm/attributes.py", line 237, in get
return self.impl.get(instance_state(instance), dict)
File "/Users/mjm/Dropbox/Devel/Experiments/pyramid/kottitest/venv2/lib/python2.7/site-packages/sqlalchemy/orm/attributes.py", line 583, in get
value = self.callable(state, passive)
File "/Users/mjm/Dropbox/Devel/_Experiments/pyramid/kottitest/venv2/lib/python2.7/site-packages/sqlalchemy/orm/strategies.py", line 505, in _load_for_state
(orm_util.state_str(state), self.key)
DetachedInstanceError: Parent instance <Document at 0x1141a2590> is not bound to a Session; lazy load operation of attribute 'parent' cannot proceed
- Expression: "api.render_template('kotti:templates/view/nav.pt')"
- Filename: ... b/python2.7/site-packages/kotti/templates/view/master.pt
- Location: (line 33: col 22)
- Source: ... lace="api.render_template('kotti:templates/view/nav.pt')" />
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- Expression: "${api.inside(context, item) and 'active' or None}"
- Filename: ... /lib/python2.7/site-packages/kotti/templates/view/nav.pt
- Location: (line 27: col 19)
- Source: class="${api.inside(context, item) and 'active' or None}">
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- Arguments: context: <Document at 0x1141a2590>
repeat: {...} (0)
renderer_name: kotti:templates/view/nav.pt
req: <Request - at 0x11420e450>
i: <FileWithPreview test at 0x1141bd350>
items: <list - at 0x114260ef0>
request: <Request - at 0x11420e450>
api: <TemplateAPI - at 0x11425dd50>
item: <Document about at 0x111cea810>
renderer_info: <RendererHelper - at 0x111b24bd0>
view: <NoneType - at 0x10e86fe58>
`