[ZPT] Help with tal:condition please

Jon Bowlas me at jonbowlas.com
Mon Sep 5 11:31:07 EDT 2005


Hi All,

I've written the snip of code below but I cant get it work, can anyone point
out my glaring error?

This code should display the first readonly input field if the Id of the
object is either uclattributes or uclaudjectsfilter, otherwise it should
display the editable field.


<tal:editableids tal:define="objId object/getId;
	     isatts python:objId=='uclattributes';
	     isaudjects python:objId=='uclaudjectsfilter'">
			<input tal:condition="python: isatts or isaudjects"
type="text" name="name"
style="width: 100%" value="value" tal:attributes="name
string:id_${object/getId}; value 			object/getId"
readonly="readonly" />
			<input tal:condition="python: not isatts or
isaudjects" type="text" name="name"
style="width: 100%" value="value" tal:attributes="name
string:id_${object/getId}; value 			object/getId" />
</tal:editableids>

However it seems to work fine for the object with the 'uclattributes' Id,
but it displays both fields when it encounters an object with the Id
'uclaudjectsfilter'.

Hope somebody can help.

Jon




More information about the ZPT mailing list