[Zope] Calling objects with a dot in them
J Cameron Cooper
jccooper at jcameroncooper.com
Thu Oct 2 15:32:10 EDT 2003
> I add a ErrCode variable to register.zpt. So in fact it redirects to
> "http://example.com/register.zpt?ErrCode=nouser".
> Now I want to add some HTML Code to the register.zpt with ZPT if
> ErrCode has the value "nouser". The problem is that ErrCode is not
> given in all cases. How can I do that? I suppose something with
> tal:condition but I don't really know how..
One way might be:
<span tal:condition="python:request['ErrCode']=='nouser'"
tal:on-error="nothing">A!</span>
The span, of course, can be any tag, or go away with a tal:omit-tag.
You may want to check error types if you do anything more complex than
checking a REQUEST parameter. Check the online help for details on that.
--jcc
--
"Code generators follow the 80/20 rule. They solve most of the problems, but not all of the problems. There are always features and edge cases that will need hand-coding. Even if code generation could build 100 percent of the application, there will still be an endless supply of boring meetings about feature design."
(http://www.devx.com/java/editorial/15511)
More information about the Zope
mailing list