On 11/7/06, Matt Wilson <[EMAIL PROTECTED]> wrote:
>
> For controller foo, I want a "foo returns success" template, and a "foo
> returns failure" template.
>
> Pretend that when foo returns s=1, I want the background to be blue,
> and when foo returns s=0, I want a red background
>
> I want to avoid putting conditional logic in my kid file. I'd rather
> just have two separate kid files.
>
> I can't figure out how to do this, because I think I have to choose the
> kid file in the decorator of my controller method.
>
> Any advice welcome.
>
you can also do
@expose(template="templates.ok")
def foo(self):
if (not s):
return(tg_template="templates.notOK",other="bar"
return(other="bar")
if tg_templates is defined it will use that if not it will fallback to
whatever is in exposed.
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---