On Jun 5, 1:42 am, "[email protected]" <[email protected]>
wrote:
> hello,
>
> i'am new to python and pylons. after trying pylons for a couple days i
> have found that I can't use 'forward' as action name.
>
> here my controller hello.py:
> class HelloController(BaseController):
>
>     def index(self):
>         # Return a rendered template
>         #return render('/hello.mako')
>         # or, return a response
>         return 'Hello World'
>
>     def inform(self):
>         return redirect_to(controller='hello', action='forward',
> id='hello')
>
>     def forward(self, data=None):
>         return "your data is: %s" %data
>
> when i browse tohttp://127.0.0.1:5000/hello/inform, it's redirected
> to forward action but the id ('hello') was not passed to forward
> action so the output in browser become:
>
> your data is: None

Depending on how your routes are set up, `id` might be a query
parameter. In that case, you'd access it in the `forward` action via
`request.params`.

Another possibility is that you just need to rename the `data` arg to
`forward()` to `id`.

> I have trying in few project, and the result is always same. the same
> output happened when I using
> h.url_for(controller='map', action='forward', id='xx') in mako
> templates.
>
> Any suggestion ?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" 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/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to