[Zope] Python Script that modifies a document property

Evan Simpson evan@4-am.com
Wed, 11 Apr 2001 19:26:25 -0400


From: "Cary O'Brien" <cobrien@Radix.Net>
> I want to have a python script that, when called from a dtml-document,
> will modify the properties of that document[1].  How do I get to the
> document itself?  context and container both reference the the folder
> with the python script in it!

Pass it as an argument.  DTML's magic can be helpful, but it can also get in
your way, and saying what you mean can save you confusion later:

  <dtml-call expr="myScript(this())">

Alternatively, you can use the Bindings tab of the Script to get the
caller's namespace, and refer to the Document as:

_['this']

Cheers,

Evan @ digicool & 4-am