[ZPT] REQUEST argument

richard@bizarsoftware.com.au richard@bizarsoftware.com.au
Mon, 14 May 2001 08:58:43 +1000


Evan Simpson wrote:
> 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.

Great! Less mess, more fun :)


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

This is very much what I was hoping for. It definitely matches the most
common use case in the thousands of lines of ZPT we've accumulated. So yay
:)


    Richard

-- 
Richard Jones
richard@bizarsoftware.com.au
Senior Software Developer, Bizar Software (www.bizarsoftware.com.au)