Thanks,<br>I tried your suggestion Jonathan and I get this:<br><strong>Error Type: AttributeError</strong><br> <strong>Error Value: has_key<br></strong>Thanks anyway.<br>I never used ZPT, I'm not sure how to approach it from that angle...<br>would it be easy to do? (You mean tal and metal right?)<br><br><br>Anyone have any other suggestions?<br>Thanks<br><br><b><i>Jonathan <dev101@magma.ca></i></b> wrote:<blockquote class="replbq" style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta content="MSHTML 6.00.2900.2912" name="GENERATOR"> <style></style> <div><font face="Arial" size="2">It might make your life easier if you used a dtml-let (WARNING: untested):</font></div> <div><font face="Arial" size="2"></font> </div> <div><font face="Arial" size="2"><dtml-in dictList="ScriptThatReturnsAListofDicts()"></font></div> <div><font
face="Arial" size="2"> <dtml-let aDict="_['sequence-item']"></font></div> <div><font face="Arial" size="2"> <dtml-if "aDict.has_key('titled')"></font></div> <div><font face="Arial" size="2"> do something here</font></div> <div><font face="Arial" size="2"></font> </div> <div><font face="Arial" size="2"></font> </div> <div><font face="Arial" size="2">But this is still pretty ugly. Another approach would be to clean up the data in your list/dicts within the python script, before you get to the dtml method.</font></div> <div><font face="Arial" size="2"></font> </div> <div><font face="Arial" size="2"></font> </div> <div><font face="Arial" size="2">Jonathan</font></div> <div><font face="Arial" size="2"></font> </div> <div><font face="Arial" size="2"></font> </div> <div><font face="Arial" size="2"></font> </div> <blockquote
style="border-left: 2px solid rgb(0, 0, 0); padding-right: 0px; padding-left: 5px; margin-left: 5px; margin-right: 0px;"> <div style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">----- Original Message ----- </div> <div style="background: rgb(228, 228, 228) none repeat scroll 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"><b>From:</b> <a title="aluminum3458@yahoo.com" href="mailto:aluminum3458@yahoo.com">Alric Aneron</a> </div> <div style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch:
normal;"><b>To:</b> <a title="zope@zope.org" href="mailto:zope@zope.org">zope@zope.org</a> </div> <div style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"><b>Sent:</b> Monday, June 19, 2006 2:46 PM</div> <div style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"><b>Subject:</b> [Zope] dictionary from sequence-item</div> <div><br></div>Hello,<br>I am looping through a list of dictionary objects using <dtml-in...<br>and within the dtml-in body I have:<br><dtml-var "_.getitem('sequence-item')['titled']" missing="none"><br>Some of the dictionaries in the list don't have 'titled' key so it should replace it with the word "none", but it gives me an error<br><strong>Error Type:
KeyError</strong><br><strong>Error Value: 'titled'<br></strong>I don't understand. Another option is that I can use <dtml-if "_.getitem('sequence-item').has_key('titled')"> but it doesn't work, says has_key is an unknown attribute. This is the stupidest thing ever! it's a dictionary object!<br>I try to typecast it using the dict(_.getitem('sequence-item')).has_key('titled') it gives me an error saying it can't typecast, but I am 100% sure it's a dictionary object because I can access it easily _.getitem('sequence-item')['titled'] for those that have that key.<br><br>Any idea how I can check if the titled key is in the dictionary for the current list item?<br><br>Thanks in advance guys!<br> <div> </div><hr size="1"> <a href="http://us.rd.yahoo.com/mail_us/taglines/postman3/*http://us.rd.yahoo.com/evt=39666/*http://messenger.yahoo.com">Yahoo! Messenger with Voice.</a> PC-to-Phone calls for ridiculously low rates. <div>
</div><hr> <div></div>_______________________________________________<br>Zope maillist - Zope@zope.org<br>http://mail.zope.org/mailman/listinfo/zope<br>** No cross posts or HTML encoding! **<br>(Related lists - <br> http://mail.zope.org/mailman/listinfo/zope-announce<br> http://mail.zope.org/mailman/listinfo/zope-dev )<br></blockquote></blockquote><br><p>
                <hr size=1>Love cheap thrills? Enjoy PC-to-Phone <a href="http://us.rd.yahoo.com/mail_us/taglines/postman9/*http://us.rd.yahoo.com/evt=39666/*http://messenger.yahoo.com/"> calls to 30+ countries</a> for just 2¢/min with Yahoo! Messenger with Voice.