newbie dtml-if/expr ?
(zope-2.1.6, rh6-linux) How come I can't do this: <dtml-if "var1 and var2"> <dtml-call somefuncNeedingVar1AndVar2> </dtml-if> ...or other obvious (e.g. (extra) (parenthesized)) variations thereupon, but the following seem to work: <dtml-if "_.has_key('var1') and _.has_key('var2')"> ... </dtml-if> ...or this... <dtml-if "_.has_key('var1') and _.var2"> <!-- but not vice-versa --> ... </dtml-if> ...or even worse, this... <dtml-if var1> <dtml-if var2> ... </dtml-if> </dtml-if> Can't seem to find the answer in the zqr or dtml reference... what am I missing here? Hopefully there's a simple answer. :) Many thanks, -Dan
Daniel Chudnov wrote:
(zope-2.1.6, rh6-linux)
How come I can't do this:
<dtml-if "var1 and var2"> <dtml-call somefuncNeedingVar1AndVar2> </dtml-if>
Your problem is probably related to namespaces and aquisition. Aquisition is best monster you'll ever meet. <s> What you're calling can't find var1 & var2. You could use the -with tag in most cases (see DMTL Guide & ZQR). I found reading these helped... http://www.zope.org/Members/Hoekstra/ChangingZopeContexts http://www.zope.org/Documentation/How-To/AdvancedDTML http://www.zope.org/Members/chrisw/showaq http://www.zope.org/Members/cybertad/how_to/working_with_tree ...then I read almost the entire mailing list archives, then all of the HowTos Just kidding, it's not that bad. Now you're ready for: http://www.zope.org/Members/jim/Info/IPC8/AcquisitionAlgebra/siframes.htm (but I bet the talk was better than just the slides <g>). HTH, -- Tim Cook -- Cook Information Systems | Office: (901) 884-4126 8am-5pm CDT * Specializing in Open Source Business Systems * FreePM Project Coordinator http://www.freepm.org OSHCA Founding Supporter http://www.oshca.org
On Mon, 11 Sep 2000, Tim Cook wrote: Your problem is probably related to namespaces and aquisition. Aquisition is best monster you'll ever meet. <s> <snip/> FreePM Project Coordinator http://www.freepm.org OSHCA Founding Supporter http://www.oshca.org ...hey thanks for the reading list. I will go through them all. Darn zope docs are getting worse as I learn more. :) Btw I've seen the projects you're working on before as I've done some work in medical data standards (hl7, corbamed, etc.) and such in a past life and work towards more free software in the present. How's the openhealth effort going? Have you had much direct contact with the O'Reilly folks who are thinking along the same lines? Regards, -Dan Daniel Chudnov Systems Architect Cushing/Whitney Medical Library Yale University School of Medicine (203) 785-4347
participants (2)
-
Daniel Chudnov -
Tim Cook