[Zope] Rendering DTML from PythonScript

Joel Burton jburton@scw.org
Wed, 21 Mar 2001 09:08:31 -0500 (EST)


On Wed, 21 Mar 2001, Oleg Broytmann wrote:

> On Wed, 21 Mar 2001, Joel Burton wrote:
> > I have a PythonScript that uses traversal_subpath to suck in the rest of
> > the path, and then calls a standard DTML document to render it, with the
> > subpath being handed off in the namespace.
> >
> > The script just has
> >
> >   """Call the faculty page for this faculty member"""
> >
> >   context.facsearch(facid = traverse_subpath[0])
> >
> >
> > However, the called DTML itself calls things like standard_html_header,
> > which throw up errors.
> >
> > How can I call a DTML method from a PythonScript while passing in the
> > right context?
> 
> <untested>
>    context.facsearch(context, context.REQUEST, facid = traverse_subpath[0])
> </untested>

Oleg (& others)--

Thanks. This seems closer, but, something is still strange.

My exact Python script is called 'faculty':

   """Grab the path and get the faculty body."""

   context.facbody(context, context.REQUEST, facid=traverse_subpath[0])

My exact DTML script is 'facbody':

   <dtml-var standard_html_header>
     You were looking for &dtml-facid;
   <dtml-var standard_html_footer>

When I call facbody?facid=foo (test case), I get the expected 'You were
looking for foo'

When I call faculty/foo, I get a response with Content-Length: 0.

Any ideas what is going on?
-- 
Joel Burton   <jburton@scw.org>
Director of Information Systems, Support Center of Washington