le 12.02.2009 15:30 Victor a écrit:
> Hi,
>
> @tg.expose()
> def default(self, name, action, *args, **kwargs):
> return "hello %s %s %s %s" % (name, action, args, kwargs)
>
> It works. But here comes the problem is. How can I redirect the
> request without change of url to my controller? I know that I can
> redirect with redirect function like this:
>
> @tg.expose()
> def default(self, name, action, *args, **kwargs):
> redirect(tg.url('/site', dict(name=name, action=action,
> **kwargs)))
>
>
That's a good start...
@tg.expose()
def default(self, name, action, *args, **kwargs):
# check if action is a method of your controller
action_method = getattr(self, action, None)
if action_method:
return action_method(name, *args, **kwargs)
...
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" 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?hl=en
-~----------~----~----~----~------~----~------~--~---