FSSession and calling DTML Methods in various ways
I've got a DTML method that looks like this: Id: checksession <code> <dtml-if "FSSession.has_key('session')"> <dtml-return "1"> <dtml-else> <dtml-return "0"> </dtml-if> </code> Then a DTML Document: Id: index_html <code> <dtml-call FSSession> <dtml-if checksession> COOL! <dtml-else> Not so cool buddy </dtml-if> </code> This now works fine and the DTML Method (checksession) has FSSession in it's stacks thanks to index_html calling it as you should do. The problem is when I call checksession like a python expression. This fails: Id: index_html <code> <dtml-call FSSession> <dtml-if "checksession()"> COOL! <dtml-else> Not so cool buddy </dtml-if> </code> It in the latter case fails to find the FSSession object. In the above example, it looks easy to fix, but in reality it's a bit more complicated. What's the difference between <dtml-call someDTMLMethod_dtml> and <dtml-call "someDTMLMethod_dtml()"> ??
On Wed, 21 Feb 2001, Peter Bengtsson wrote:
What's the difference between <dtml-call someDTMLMethod_dtml> and <dtml-call "someDTMLMethod_dtml()"> ??
This <dtml-call someDTMLMethod_dtml> is <dtml-call "someDTMLMethod_dtml(_.None, _)"> DTML objects are called with 2 parameters - client and namespace! In case of <dtml-call someDTMLMethod_dtml> Zope automagically supplies these 2. Oleg. ---- Oleg Broytmann http://www.zope.org/Members/phd/ phd@phd.pp.ru Programmers don't die, they just GOSUB without RETURN.
participants (2)
-
Oleg Broytmann -
Peter Bengtsson