[Zope-dev] Using DTML is too difficult

Anthony Pfrunder s341625@student.uq.edu.au
Thu, 11 Nov 1999 09:05:36 +1000 (GMT+1000)


On Thu, 11 Nov 1999, Itamar Shtull-Trauring wrote:

[snip]
> Not to mention the ability to do some really cool stuff with ZCatalogs (find
> all items beginning with the letter 'A', searching using metaphone or
> soundex [I did this, if anyon'es interested], etc.)  I can't figure how to
> do the <dtml-with> tag in python, though.

<dtml-with MyStuff>
  <dtml-var coolstuff>
</dtml-with>

--> self.MyStuff.coolstuff(REQUEST)

The other way is to "emulate" a dictionary (which is all REQUEST is) and
pass that to your Python Method and then use it to look things up.  The
(yet) other way is to "emulate" an __of__ relationship in the base class
and then every attribute acquisition is passed to your class and you can
do what you wish in the ZClasses Python Method. 

Cheers,

Anthony Pfrunder
Computer Systems Engineering
University of Queensland