I can do: tal:condition="exists:date_edited" and I can do: tal:condition="hasThePermision" I can even do: tal:condition="date_edited | hasThePermission" but how do I do tal:condition="date_edited AND hasThePermission" Given that date_edited may not exist in the namespace, using python has it's own unique problems. The following errors if date_edited isn't found. tal:condition="python:hasThePermission and date_edited" Is there an easy way to do this test in one statement? Mark
Hello Mark, Saturday, October 19, 2002, 11:24:28 PM, you wrote: MG> I can do: MG> tal:condition="exists:date_edited" MG> and I can do: MG> tal:condition="hasThePermision" MG> I can even do: MG> tal:condition="date_edited | hasThePermission" MG> but how do I do MG> tal:condition="date_edited AND hasThePermission" MG> Given that date_edited may not exist in the namespace, using python has it's own MG> unique problems. The following errors if date_edited isn't found. MG> tal:condition="python:hasThePermission and date_edited" MG> Is there an easy way to do this test in one statement? the 'path' method available in pythons-statements is your friend in situations like these : <untested> tal:condition=" path('hasThePermission') and path('date_edited | nothing') </untested> 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... ;)
hope to help :) -- Geir Bækholt geirh@funcom.com
I haven't tested this either, but I think Geir means to use the python: prefix: tal:condition="python:path('hasThePermission') and path('date_edited | nothing')" Troy Geir Bækholt wrote:
Hello Mark, Saturday, October 19, 2002, 11:24:28 PM, you wrote: MG> I can do: MG> tal:condition="exists:date_edited" MG> and I can do: MG> tal:condition="hasThePermision" MG> I can even do: MG> tal:condition="date_edited | hasThePermission"
MG> but how do I do MG> tal:condition="date_edited AND hasThePermission"
MG> Given that date_edited may not exist in the namespace, using python has it's own MG> unique problems. The following errors if date_edited isn't found.
MG> tal:condition="python:hasThePermission and date_edited"
MG> Is there an easy way to do this test in one statement?
the 'path' method available in pythons-statements is your friend in situations like these :
<untested> tal:condition=" path('hasThePermission') and path('date_edited | nothing') </untested>
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... ;)
hope to help :)
Thanks for the suggestions. With a little tweaking, I came up with the behavior I wanted. tal:condition="python:path('hasThePermission') and path('request/date_edited | date_edited | nothing') It does seem that since path has an 'or' operator, it should also have an 'and' operator. Mark
I haven't tested this either, but I think Geir means to use the python: prefix:
tal:condition="python:path('hasThePermission') and path('date_edited | nothing')"
Troy
Geir Bækholt wrote:
Hello Mark, Saturday, October 19, 2002, 11:24:28 PM, you wrote: MG> I can do: MG> tal:condition="exists:date_edited" MG> and I can do: MG> tal:condition="hasThePermision" MG> I can even do: MG> tal:condition="date_edited | hasThePermission"
MG> but how do I do MG> tal:condition="date_edited AND hasThePermission"
MG> Given that date_edited may not exist in the namespace, using python has it's own MG> unique problems. The following errors if date_edited isn't found.
MG> tal:condition="python:hasThePermission and date_edited"
MG> Is there an easy way to do this test in one statement?
the 'path' method available in pythons-statements is your friend in situations like these :
<untested> tal:condition=" path('hasThePermission') and path('date_edited | nothing') </untested>
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... ;)
hope to help :)
on or about, Sunday, October 20, 2002, we have reason to believe that Troy Farrell wrote something along the lines of : TF> I haven't tested this either, but I think Geir means to use the python: TF> prefix: TF> tal:condition="python:path('hasThePermission') and path('date_edited | TF> nothing')" errh .. of course.. ;) - just testing if you were awake.. my bad.. :) -- Geir Bækholt geir@funcom.com Funcom Oslo
participants (5)
-
Geir Bækholt -
Geir B�kholt -
Mark Gibson -
mark@dimensional.com -
Troy Farrell