I just used this solution myself, and wanted to make this even more
explicit - so other people will have an easier time doing this.
from tg.decorators import override_template
# within the controller function, if the function is "save"
override_template(self.save, "genshi:path.to.template.name")
##############################
# here is a little more code to make it even more understandable:
from tg.decorators import override_template
class JobController(BaseController):
#...
@expose('path.to.template.save')
def save(self, **kw):
if self.check_for_conflicts(kw):
override_template(self.save,
'genshi:path.to.template.conflict_list')
# note: check_for_conflicts added info to kw about
conflicts found
return kw
#... normal save
return dict(...)
-Laurin
On Jul 3, 4:19 am, "Diez B. Roggisch" <[email protected]> wrote:
> Ryan Michael schrieb:
>
> > Thanks - that did it!
>
> > I can't find that function at all in the documentation - I assume the
> > docs are still a work in progress, or am I not looking in the right
> > place?
>
> They are a work in progress (too slow progress unfortunately), but that
> certainly should be in there.
>
> And it is
>
> http://turbogears.org/2.0/docs/modules/tgdecorators.html
>
> However, I found this only because I manipulated the URL - so it appears
> as if there is an error in the doc-generation-process.
>
> Diez
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---