Hi All, Just a quickie to see if I can do this: tal:condition="python:context.REQUEST.model.meta_type=='Silva Publication' or context.REQUEST.model.is_default()" When I test it seems to ignore the 2nd condition, so could anyone suggest the correct syntax. Cheers Jon
--On 22. August 2006 15:36:20 +0100 Jonathan Bowlas <me@jonbowlas.com> wrote:
Hi All,
Just a quickie to see if I can do this:
tal:condition="python:context.REQUEST.model.meta_type=='Silva Publication' or context.REQUEST.model.is_default()"
If the first part of the OR clause evaluates to True then there is no need to evaluate the second part (optimization). -aj
So what if the first part evaluates to false? Which is what would happen in my case, it doesn't then test for the 2nd condition? J -----Original Message----- From: Andreas Jung [mailto:lists@zopyx.com] Sent: 22 August 2006 15:43 To: me@jonbowlas.com; zope@zope.org Subject: Re: [Zope] Multiple conditions inside tales --On 22. August 2006 15:36:20 +0100 Jonathan Bowlas <me@jonbowlas.com> wrote:
Hi All,
Just a quickie to see if I can do this:
tal:condition="python:context.REQUEST.model.meta_type=='Silva Publication' or context.REQUEST.model.is_default()"
If the first part of the OR clause evaluates to True then there is no need to evaluate the second part (optimization). -aj
--On 22. August 2006 17:37:40 +0100 Jonathan Bowlas <me@jonbowlas.com> wrote:
So what if the first part evaluates to false? Which is what would happen in my case, it doesn't then test for the 2nd condition?
J
Did I say said? No, I didn't. And of course the second part will be evaluated if the first one evals to False. If you can provide a reproducable testcase that provides evidence, I'll believe in your original statement. Currently I don't :-) -aj
Ok, so it was the tal inside this condition that contained the error, you were right, it was correct. Sorry for wasting your time. Thanks to Andreas and Dieter for their help anyway. J -----Original Message----- From: Andreas Jung [mailto:lists@zopyx.com] Sent: 22 August 2006 17:49 To: me@jonbowlas.com; 'Andreas Jung'; zope@zope.org Subject: RE: [Zope] Multiple conditions inside tales --On 22. August 2006 17:37:40 +0100 Jonathan Bowlas <me@jonbowlas.com> wrote:
So what if the first part evaluates to false? Which is what would happen in my case, it doesn't then test for the 2nd condition?
J
Did I say said? No, I didn't. And of course the second part will be evaluated if the first one evals to False. If you can provide a reproducable testcase that provides evidence, I'll believe in your original statement. Currently I don't :-) -aj
Jonathan Bowlas wrote at 2006-8-22 15:36 +0100:
Just a quickie to see if I can do this:
tal:condition="python:context.REQUEST.model.meta_type=='Silva Publication' or context.REQUEST.model.is_default()"
When I test it seems to ignore the 2nd condition, so could anyone suggest the correct syntax.
The syntax is correct (at least, if you mean "or" and not "and"). And it should work... -- Dieter
participants (3)
-
Andreas Jung -
Dieter Maurer -
Jonathan Bowlas