[Zope] tree tag's namespace

Dieter Maurer dieter@handshake.de
Mon, 8 Jul 2002 20:46:11 +0200


Jerome Alet writes:
 > I've got <dtml-tree> which branches_expr calls a method
 > which returns a list of mappings.
 > ....
 > is there a solution ?
I fear "dtml-tree" requires a list of objects not mappings.

 > if no, then could the 'mapping' keyword be added to the tree tag
 > and let it work like for dtml-in ? (I've looked at the code but
 > I really don't know how to do)
In principle, yes. But it would be quite some work.

I would go a different route:

  *  extend "ZPublisher.HTTPRequest.record" by a useful "__init__" method:

	    def __init__(self,**kw):
	      d= self.__dict__
	      for k,v in kw.items(): d[k]= v

  *  make it accessible from Python Scripts and ZPT by providing some useful
     security declarations

  *  make it available to DTML by adding it to "TemplateDict"
     in "DocumentTemplate.DT_Util".

This would make simple "record" instance construction available
for TTW code, something lacking from Zope!


Dieter