respondapp_iter = self.application(environ, detect_start_response)
__call__return self.wrap_app(environ, session_start_response)
__call__response = self.app(environ, start_response)
__call__response = self.dispatch(controller, environ, start_response)
dispatchreturn controller(environ, start_response)
__call__return WSGIController.__call__(self, environ, start_response)
__call__response = self._dispatch_call()
_dispatch_callresponse = self._inspect_call(func)
_inspect_callresult = self._perform_call(func, args)
_perform_callreturn func(**args)
listreturn render('/derived/page/list.html')
render_makocache_type=cache_type, cache_expire=cache_expire)
cached_templatereturn render_func()
render_templatereturn literal(template.render_unicode(**globs))
render_unicodeas_unicode=True)
_render_render_context(template, callable_, context, *args, **_kwargs_for_callable(callable_, data))
_render_context_exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
_exec_template_render_error(template, context, e)
_render_errorresult = template.error_handler(context, error)
_exec_templatecallable_(context, *args, **kwargs)
render_body__M_writer(escape(next.body()))
<lambda>return lambda *args, **kwargs:callable_(self.context, *args, **kwargs)
render_body__M_writer(escape( c.paginator.pager('$link_first $link_previous $first_item to $last_item of $item_count $link_next $link_last') ))
pager_pagerlink(self.last_page, symbol_last) or '',
_pagerlinklink_url = url_for(**link_params)
url_forencoding = config.mapper.encoding
__getattr__return getattr(self.__shared_state, name)
AttributeError: 'thread._local' object has no attribute 'mapper'
No Description Entered
| beaker | 1.5.4 |
| decorator | 3.2.0 |
| formencode | 1.2.2 |
| mako | 0.3.4 |
| markupsafe | 0.9.2 |
| nose | 0.11.3 |
| paste | 1.7.4 |
| pastedeploy | 1.3.3 |
| pastescript | 1.7.3 |
| pygments | 1.3.1 |
| pylons | 1.0 |
| routes | 1.12.3 |
| simplejson | 2.1.1 |
| sqlalchemy | 0.5.8 |
| tempita | 0.4 |
| weberror | 0.10.2 |
| webhelpers | 0.6.4 |
| webob | 0.9.8 |
| webtest | 1.2.1 |
Powered by Pylons - Contact Administrators
Comments (7)
Hi everyone,
I’m stopped on pagination on the wonderful tutorial : http://pylonsbook.com/en/1.1/starting-the-simplesite-tutorial.html#using-pagination
I try to made the tutorial and adapt it when I can. The first problem I had is link to routes.url_for seems to be depreced and return me lot of mapper problems. I changed all my h.url_for by url… but it seems to be used to in import webhelpers.paginate as paginate
if someone have an idea…
Thanks
All my code is available on : http://bitbucket.org/kyoku57/simplesite/overview
After reading : http://pylonshq.com/docs/en/1.0/thirdparty/webhelpers/paginate/
I had in my controller ‘page’ action=‘list’:
mapper = Mapper()
mapper.connect(’/page/list’)
Exemple :
def list(self):
mapper = Mapper()
mapper.connect(’/page/list’)
records = model.meta.Session.query(model.Page)
c.paginator = paginate.Page(
records,
page=int(request.params.get(‘page’, 1)),
items_per_page = 5,
)
return render(’/derived/page/list.html’)
It’s work, but I’m sure that there is a proper way, no ?
Perhaps with herit webhelpers.pagination and change all reference to url_for by pylons.url ?
I’m having the same problem.
See:
http://pylonshq.com/tracebacks/14548f91ecebd8d0b2ed227dffbc3771
here is a solution:
http://pylonsdevelopment.blogspot.com/2010/07/attributeerror-threadlocal-object-has.html
Thank you!
Suggest a fix or tip to help solve this traceback.
You must login before you can comment.