[Zope] tal:condition AND

Troy Farrell troy@entheossoft.com
Sun, 20 Oct 2002 15:53:48 -0500


I haven't tested this either, but I think Geir means to use the python:=20
prefix:

tal:condition=3D"python:path('hasThePermission') and path('date_edited |=20
nothing')"

Troy


Geir B=E6kholt wrote:
> Hello Mark,=20
> Saturday, October 19, 2002, 11:24:28 PM, you wrote:
> MG> I can do:
> MG>   tal:condition=3D"exists:date_edited"
> MG> and I can do:
> MG>   tal:condition=3D"hasThePermision"
> MG> I can even do:
> MG>   tal:condition=3D"date_edited | hasThePermission"
>=20
> MG> but how do I do
> MG>   tal:condition=3D"date_edited AND hasThePermission"
>=20
> MG> Given that date_edited may not exist in the namespace, using python=
 has it's own=20
> MG> unique problems.  The following errors if date_edited isn't found.
>=20
> MG>   tal:condition=3D"python:hasThePermission and date_edited"
>=20
> MG> Is there an easy way to do this test in one statement?
>=20
> the 'path' method available in pythons-statements is your friend in
> situations like these :
>=20
> <untested>
>    tal:condition=3D" path('hasThePermission') and path('date_edited | n=
othing')
> </untested>
>=20
> this just might work.. this one might fail (not give an error, but
> produce the wrong result) if 'date_edited' exists, but is not true in a
> pythonian boolean sense.
>>From how i understand what you are trying to do , this is probably
> never going to happen anyway...  ;)
>=20
> hope to help :)
>=20