[ZPT] REQUEST argument
Evan Simpson
evan@digicool.com
Fri, 11 May 2001 23:49:06 -0400
From: <richard@bizarsoftware.com.au>
> I'm doing "python:here.someMethod(request)" a lot, where it'd be much
> neater (and easier on the end template creator) to just have
> "here/someMethod". What's the chances of having the request argument
> automagically passed in?
I think I have this worked out in CVS. I wanted to place the request, the
'here' object, and the Page Template variables defined at the call point on
the namespace passed to DTML.
I've replace the DTMLFiles used for the ZPT add and edit screen with
PageTemplateFile instances, and it works pretty well. It invokes the
'manage_page_header', 'manage_tabs', 'manage_form_title', and
'manage_page_footer' DTMLFiles. To make it all work correctly without reams
of code, I implemented the '|' operator and 'default', and in the process
discovered that most of the places I used them I wanted '|' to stop on any
valid path, not just true-valued ones. The other style can be spelled
"python:path('a/b') or path('c/d')", since the error value for an invalid
path evaluates as false.
Cheers,
Evan @ digicool