I can substitute a property name for the base of an object call with: <dtml-var expr="_[wrap].index_html(_.None,_)"> where wrap is a property that refers the name of an object But I have not been able to figure out how to use a variable to substitute the method (in this case index_html but could be index_xml or index_wap) If I use the above methodology - I get looping login boxes where it won't authenticate and when I hit cancel I get a traceback in file DT_Util.py line 142, in careful_getattr. Is there a way to do this?? Thanks Lou
Please do not post HTML messages! Lou Scalpati writes:
I can substitute a property name for the base of an object call with:
<dtml-var expr="_[wrap].index_html(_.None,_)"> where wrap is a property that refers the name of an object
But I have not been able to figure out how to use a variable to substitute the method (in this case index_html but could be index_xml or index_wap) You call for "Computed Attribute Access". You can use "getattr" for this. Its a method of "_". Thus, you would use:
<dtml-var expr="_.getattr(_.getitem(wrap),*YOUR METHOD EXPRESSION*)(_.None,_)> e.g. <dtml-var expr="_.getattr(_.getitem(wrap),'index_html')(_.None,_)> Dieter
participants (2)
-
Dieter Maurer -
Lou Scalpati