I've been fighting with redirect for a while, trying to do things that
I'm used to being able to do in Django and Catalyst.

The docs on tg.redirect and tg.url are fairly sparse, so I have no
clue if this should work or not.

But what I have is two controllers, mounted within each other. Most of
the methods in the second (nested) controller redirect back to the
index when done making changes. (They are buttons on the index page
and don't have templates.) But since one controller is within the
other, I didn't want to hardcode 'redirect(/x/y/)' everwhere, as the
location of the controllers might change over time. I've tried the
following options with no luck:

redirect(self.index)   # This would be preferable. If you could
redirect to an @expose'd method.
redirect('') # Redirect to the index of this controller?
redirect() # Alternative version of the same?
redirect (action='index') # Should work via routes, but errors out.

At a very least, there seems to be this bug in tg.url:

if isinstance(args[0], list):
    args[0] = u'/'.join(args[0])
if args and isinstance(args[0], basestring):
    ...

Shouldn't the first line be 'if args and isinstance(args[0], list):'
so that we can avoid passing an initial non-keyword argument and use
the routes version of url?


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to