[ZPT] Mpoll modifications (zpt)

G. Clifford Williams gcw-python at rezidew.net
Wed Aug 6 23:17:48 EDT 2003


I'm stuck with the following code. What I need is to either limit the 
portal_catalog.searchResults to just the single most recent item or change 
the iterator to only process the first item in the 'results' sequence. 

Any help would be greatly appreciated..

     tal:define="results 
python:here.portal_catalog.searchResults(meta_type='MPoll', sort_on='Date', 
sort_order='reverse', review_state='published', effective=here.ZopeTime(), 
effective_usage='range:max', expires=here.ZopeTime(), 
expires_usage='range:min')">

    <div class="box" tal:condition="results" tal:define="Iterator 
python:modules['Products.CMFPlone'].IndexIterator;
                                 tabindex python:Iterator();">
    
        <h5 i18n:translate="box_poll">Poll</h5>

        <div class="body">

            <tal:block tal:repeat="result results">
                <div class="content even" tal:define="obj result/getObject">
	            <span style="font-weight: bold"  
tal:content="obj/getQuestion"></span>
                </div>




More information about the ZPT mailing list