Return tg_template="your other template" in the dictionary that comes
back from your method. You can also call another method as an
alternative (return self.print_error(foo, bar, baz))

http://www.turbogears.org/preview/docs/gs/templatechoice.html

Kevin

On 5/5/06, Fred C <[EMAIL PROTECTED]> wrote:
>
>
> Hello gang.
>
> I am going crazy looking into the mailing list archive to find an email
> posted a couple of weeks ago by Michelle (I think) and I am sorry to ask
> this again.
>
> I want to change the template name in the middle of my function to print an
> error page instead of the normal template.
>
> I have something who look like that.
>
> @expose(template="foo.template.search")
> def search(self, *args):
>  ...
>  found = search(what)
>  if len(found) == 0:
>  # change the template name here to "foo.template.notfound"
>  return dict(title='Search error', message='no element found'
>
>  return dict(title="yeah!", found=found)
>
> Thanks for your help.
>
> -fred-
>
>
>
>  >
>


--
Kevin Dangoor
TurboGears / Zesty News

email: [EMAIL PROTECTED]
company: http://www.BlazingThings.com
blog: http://www.BlueSkyOnMars.com

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

Reply via email to