[Zope] dictionary of dictionaries syntaxis
Pablo Ziliani
pablo@decode.com.ar
Wed, 24 Oct 2001 19:50:27 -0300
Hi, people!
I am trying to build a method that returns some key:value pairs for a given
string (actually, the id of a property in a propertysheet).
My first try was to build a dictionary, which is new for me, but the
publisher returned a syntaxis problem, so i could't even save the method to
test it. Unfortunately, there was no hint on where exactly inside the
<dtml-let ...> the bug was.
here is the code:
<dtml-let PropertieS="{
'title':{'Name':'Título','Description':'Título'},
'Foto_ppal':{'Name':'Foto Principal','Description':'Foto principal del
artículo'},
'publicidad':{'Name':'Publicidad','Description':'Publicidades ubicadas bajo
el contenido principal de la página'}
}">
<dtml-if "PropertieS.has_key(property)">
<dtml-return "PropertieS[property]">
<dtml-else>
<dtml-return "{'Name':property,'Description':property}">
</dtml-if>
</dtml-let>
So, is this a reasonable way for gaining "extra fields" for "property"
value?
Anyway, if this where fine, how can I then access the values for the
resulting 'Name' and 'Description' keys?
Thanks in advance,
Pablo