[Zope] Learning Python Syntax for Zope Objects and DTML Operations

Dan Shafer pydan@danshafer.com
Fri, 03 May 2002 18:10:38 -0700


What is the recommended way to learn how to carry out both API access and 
DTML equvalence in Python scripts? I find myself frequently spending what 
seems like an inordinate amount of time trying to translate the way DTML 
deals with something into a Python equivalent. Th Zope Book basically waves 
its arms and says to consult the appendices but they don't really tell 
someone lilke me,  who doesn't already have a good idea what's going on, 
how to do this mapping.

Only by way of example, I've been working on learning iterators in DTML and 
finding the syntax pretty opaque. If I have a collection of DTML Methods in 
a folder, some of them having a property called "status" and I want to 
produce a list of *only* those DTML methods that *have* that property and 
have it set to some value, I get into some gnarly DTML code. So I figure, 
what the heck,I know how to do iterators in Python in my sleep, I'll write 
a Python script. But I can't figure out how to reference the objects, let 
alone iterate over them. I'll probably figure this out myself before too 
long, but I'm looking for a basic learning experience here. Surely someone 
somewhere has written some definitive material on how to talk to Zope and 
ZODB via Python with sufficient detail to be usable?