Hm, maybe try:
render.getattr('index' + template)(ARGS)
I no longer use web.py, so I can't verify whether this works.
On Tue, Jun 21, 2011 at 11:22 AM, Dragan Espenschied <[email protected]> wrote:
> Dear List,
> I have a case where I want to render a different template depending on what a
> user did. And I couldn't find out how to render an arbitrary template in the
> return call. Probably I am missing something very basic.
>
> return render.index()
>
> Now I have several versions of index, e.g. "index_1" or "index_2".
>
> This doesn't seem to work
>
> template = '_1'
> return render['index' + template]()
>
> I know it looks embarrassing :) Please help.
>
> drx
>
> --
> You received this message because you are subscribed to the Google Groups
> "web.py" 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/webpy?hl=en.
>
>
--
Branko Vukelić
[email protected]
[email protected]
Lead Developer
Herd Hound (tm) - Travel that doesn't bite
www.herdhound.com
--
You received this message because you are subscribed to the Google Groups
"web.py" 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/webpy?hl=en.