Getting the contents of an acquired dtml method in a python script
I'm sure this is something simple, but none of my searches have uncovered the magical sequence. I've got several sites running from a single Zope folder. Some of the content and much of the functionality is shared among the different states. Each state folder contains dtml methods containing state-specific information (abbreviation, the id number used in the database, etc.) My script needs to get the contents of the abbreviation method for some URL munging, and I can't for the life of me figure out how to get it via script. Any suggestions? Thanks! Howard Hansen http://howardsmusings.com P.S., I figured out a clunky workaround -- just passing the stateid as an argument to the script, but I'm still curious about how to do this.
Howard Hansen writes:
I'm sure this is something simple, but none of my searches have uncovered the magical sequence.
I've got several sites running from a single Zope folder. Some of the content and much of the functionality is shared among the different states. Each state folder contains dtml methods containing state-specific information (abbreviation, the id number used in the database, etc.)
My script needs to get the contents of the abbreviation method for some URL munging, and I can't for the life of me figure out how to get it via script. Not sure, what you mean with content...
You access the DTML object (usually) through acquisition via "context": context.myDTMLObject When you are interested in its source, you call its "document_src" method: context.myDTMLObject.document_src() When you want the rendered result, you call your DTML object: context.myDTMLObject(context,context.REQUEST) When you are interested in background information, please read <http://www.dieter.handshake.de/pyprojects/zope/book/chap3.html> Dieter
participants (2)
-
Dieter Maurer -
Howard Hansen