[ZPT] python scripts, traverse_subpaths, and PT

jmr@computing.com jmr@computing.com
Mon, 25 Jun 2001 18:27:50 -0500 (CDT)


I'm baffled.

I have this arrangement:

/some/path/PT/script

PT is a page template
script is a simple debugging python script; here it is:
       import string
       print '<pre>'
       print 'Absolute url():', context.absolute_url()
       print 'You have these roles: '
       print string.join(context.REQUEST.AUTHENTICATED_USER.getRoles(), ', ')
       print 'REQUEST is:'
       print '</pre>'
       print context.REQUEST
       return printed


Here's the wierd part.  I have two different instances of page
templates; they act differently here.  In one case, the script runs
and I see the URL, roles, and all the cool REQUEST stuff.  As expected.

In the other case, the PT is rendered (mostly; the images don't get
returned..) and I do not get my cool REQUEST stuff.

Huh?

How can my script not get run?

(This started out more puzzling; the real script does some small amount of work that depends on arguments passed as a subpath.)

The two PT's that act differently are quite similar to each other.
They're basically forms; at the beginning of each I call a python
script to process the form data (if it's there).  A dictionary is
passed back to the PT and the results are used in the form/page.  One
PT was originally copied from the other, in fact.

Jim Rowan
DCSI
jmr@computing.com