Oh, I think I know what's happening here. This is something I didn't
think about when we created our own turbogears baseapp, and took
pylons out of the picture, I think redirect_to is trying to use routes
to do redirection...
For now, you ought to be able to just the other function by naming it
directly and then return it's return value, but I think we need to
look into writing a TurboGears specific redirect_to function.
On Dec 15, 2007 1:23 AM, iain duncan <[EMAIL PROTECTED]> wrote:
>
> Explorations continue, but no love from redirect_to(), I get a trace
> back saying:
>
> >> found = exc(url_for(*args, **kargs))
> Module routes.util:141 in url_for
> << route = None
> static = False
> encoding = config.mapper.encoding
> url = ''
> if len(args) > 0:>> encoding = config.mapper.encoding
> Module routes:14 in __getattr__
> <<
> def __getattr__(self, name):
> return getattr(self.__shared_state, name)
>
> def __setattr__(self, name, value):>> return
> getattr(self.__shared_state, name)
> AttributeError: 'thread._local' object has no attribute 'mapper'
>
> Sounded mapper related, so I tried disabling my model, and still got the
> same thing. So all that's in the controller beyond the quickstarted
> stuff is:
>
> @expose()
> def test(self):
> return "root.test() working"
>
> @expose()
> def onwards(self):
> redirect_to('/test')
>
> I also tried changing from/to:
>
> from pylons.controllers.util import redirect_to
> from pylons.helpers import redirect_to
>
> no dice. Anyone know anything about that?
> Iain
> ( Much nicer looking tracebacks I must say! )
>
>
> >
>
--
Mark Ramm-Christensen
email: mark at compoundthinking dot com
blog: www.compoundthinking.com/blog
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears Trunk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/turbogears-trunk?hl=en
-~----------~----~----~----~------~----~------~--~---