[Zope] Rendering other objects with python script

Andreas Kostyrka andreas@kostyrka.priv.at
12 Sep 2002 13:47:25 +0200


Am Don, 2002-09-12 um 12.53 schrieb Andreas Kostyrka:
> Hi!
> 
> I'm wondering how I can get the rendering that DocumentTemplates seem to
> apply automatically with Python Scripts:
> 
> <dtml-var "_['testname']">
> 
> return getattr(context,"testname")
> 
> gives me "<Folder instace ...>"
> Trying to augment it with:
> return getattr(context,"testname")()
> or
> return getattr(context,"testname")(request)
Found my error. Seems it must be getattr(context,id)(context,request)

See also http://www.zope.org/Members/yacc/contextindex

Andreas