I ran into this awhile back. Try
this:
context.scReport(None, _)
Interestingly enough, I also learned that
you can pass things into a dtml-method and they become available to use
internally. For example with the following call:
context.scReport(None, _,
MsgToUser='Hello')
Inside your dtml-method you could do a
<dtml-var MsgToUser>
This is very usefull to passing stuff
around without cluttering up your REQUEST namespace.
Another little trick I learned. Want
to find an object via acquisition and then call it? I found that the
following worked in a python script:
methodToCall = _.getitem('methodName') #
Find object via acquisition and get handle on it.
print methodToCall(None, _) # Call
the method and print the results.
This is really usefull if you generate the
method name as I do depending on the request. ie methodToCall =
_.getitem(someStrVar + 'form') will concatenate the two strings and then look
for that object in the namespace. If you do this kind of lookups, you
should probably also check for existence before calling it, ie
_.has_key(someStrVar + 'form').
Hope that helps.
-Chris
----- Original Message -----
Sent: Tuesday, October 30, 2001 11:13
AM
Subject: [Zope] calling dtmlMethod from
python
Can anyone please help with this, I'm new to zope
and trying to write a simple python script to handle some logic which
will then call a dtml method. I'm calling the method as
such: context.scReport()
The error I'm getting back is Error Type:
KeyError
Error
Value: standard_html_header
standard_html_header is being called from the
scReport method which suggests the scReport method is being invoked but why
are we getting an error?? Any suggestions, TIA
Shaneo