Hamzat, It'd be useful to be able to understand what this DTML is trying to do... it seems like you're just looping over objects trying to find one with a particular id. Is "num" passed in as a form variable? I also don't see how the '<dtml-if "mm==test">' conditional could ever be true. I'm sure it works, but I'm not sure how. ;-) In any case, I think you probably want to use a ZCatalog for this kind of search. Brute-force search is a very expensive operation. On Mon, 2002-05-27 at 11:50, hamzatk@3dresearch.com wrote:
that is a good example for trying to use DTML where it should not be used anymore.
i suggest you move this logic into a more appropriate kind of object, such as a python script.
jens
<dtml-in "news.objectValues(['Folder'])"> <dtml-let number=sequence-number path=id> <dtml-if expr="number < _.int(num)"> <dtml-in "objectValues(['DTML Document'])"> <dtml-try> <dtml-call "REQUEST.set('mm', ZopeTime().toZone('GMT+1').strftime('%d%m%y'))"> <dtml-let test=sequence-item> <dtml-if expr="mm==test"> <font face=arial size=-5> <dtml-var expr="_.getitem(mm,1)[0:400]">....<br> <a href="&dtml-ngrHome;news/&dtml-path;"> <img src="images/morex.gif" border="0" width="60" height="23"> </a><br> <dtml-if expr="number < _.int(num)-1"> <hr size="2" width="75%"> </dtml-if> </font> </dtml-if> </dtml-let> <dtml-except> </dtml-try> </dtml-in> </dtml-if> </dtml-let> </dtml-in>
Thanks Jens for the quick response. The main point here is that i am new to python but desperate to know it. I will be greatful if you could assist to convert the dtml code to python script then this will be a starting point for me too. Regards
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )