[Zope] Object visibility...?

Colin Fox cfox@cfconsulting.ca
22 Sep 2002 16:13:11 -0700


Help! I have a python script, which calls a dtml-method, which invokes a
zpt.

The dtml-method is constructing an HTML email for me, and the zpt is the
body of the email.

I want to be able to have the dtml method use different page templates,
so I can send different pages (each of these is a report). So for this I
have a <dtml-var email>, and <dtml-var "_[reportid]"> variables.

By scrounging around the web, and looking at other source, and some
docs, I've gotten some of my DTML/email needs handled.

But I'm stuck now. When I try to execute my python script, I get a
KeyError on the page template I'm trying to load, even though the page
template is in the same directory as the dtml-method.

So, for example, the dtml-method is called 'sendreport', and the zpt I
wish to send is called 'salessummary'.

In the python script, I have this:

args = {}
args["email"] = container.get_recipient_list()
args["reportid"] = "salessummary"

container.sendreport(None, context.REQUEST, args)

Firstly - I'm not sure why the 'None, context.REQUEST' arguments come
first when invoking the DTML method, though it seems to work in another
case I have, and I got this from some presumably working code. Can
anyone point me to documentation on how a python script is supposed to
invoke a DTML method?

Secondly, when I do this, I get a KeyError on 'salessummary' - even
though it's sitting in the same directory as the DTML method. This is
*really* frustrating, as this seems to be counterintuitive behavior
(based on Zope's hierarchy rules).

Any help, suggestions or pointers (even a RTFM, as long as I know which
FM to read) would be greatly appreciated.

Thanks!
   Colin

-- 
Colin Fox                                         cfox@cfconsulting.ca
CF Consulting Inc.                                    GPG Fingerprint:
                    D8F0 84E7 E7CC 5C6C 9982  F1A7 A3EB 6EA3 BC97 572F