[Zope] FSSession and calling DTML Methods in various ways
Peter Bengtsson
peter@grenna.net
Wed, 21 Feb 2001 16:28:09 -0000
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()">
??