Batchprocessing with multiple conditions?
I have objects of a certain meta-type. They have some properties and one of the properties is a boolean. How do I make a dtml-in loop among those objects with the boolean set to yes? I dont want it to traverse any other value at all only those that match the condition should be included in the sequenze because I am doing batchprocessing like in figure 6 of http://www.zope.org/Documentation/Guides/DTML-HTML/DTML.7.5.html. I have done like this now: <dtml-if "objectValues(['Meta type'])"> <table width="600" border="0" vspace="0" hspace="0" cellpadding="0"> <dtml-in "objectValues(['Meta type'])" sort=date,submittedDate,id reverse previous size=batchSize orphan=0 skip_unauthorized start=startNumber> <tr> <td colspan="2" class="common2"> <p><b><a href="viewNewsTrigger<dtml-var sequence-query>startNumber=<dtml-var previous-sequence-start-number>"> (Previous <dtml-var previous-sequence-size>)</a></b></p> </td> </tr> </dtml-in> <dtml-in "objectValues(['Meta type'])" sort=date,submittedDate,id reverse size=batchSize orphan=0 skip_unauthorized start=startNumber> <dtml-if BOOLEAN> <tr> <td colspan="2" class="common1"> <p><dtml-var date fmt="%Y-%m-%d"> <font size="2"><b><a href="viewSelectedNews?entry=&dtml-id;">"&dtml-header;"</a></b></font></p> </td> </tr> </dtml-if> </dtml-in> <dtml-in "objectValues(['Meta type'])" sort=date,submittedDate,id reverse next size=batchSize orphan=0 skip_unauthorized start=startNumber> <tr> <td colspan="2" class="common2"> <p><b><a href="viewNewsTrigger<dtml-var sequence-query>startNumber=<dtml-var next-sequence-start-number>"> (Next <dtml-var next-sequence-size>)</a></b></p> </td> </tr> </dtml-in> </TABLE> </dtml-if> This shows only the objects I want to show but the sequences is counted wrong because even though it doesn't show the objects with BOOLEAN=false they are still counted in the dtml-in. How can I loop only the objects I want to loop? Peter
On Tue, 25 Jul 2000, Peter Arvidsson wrote:
I have objects of a certain meta-type. They have some properties and one of the properties is a boolean. How do I make a dtml-in loop among those objects with the boolean set to yes? I dont want it to traverse any other value at all only those that match the condition should be included in the sequenze because I am doing batchprocessing like in
I believe you have two choices: do if tests inside the dtml-in, or set up a ZCatalog with indexes for the relevant fields and use a catalog search call to retrieve the correct list of objects. That's still not easy if you want to do anything but an AND between the fields (see the Advanced ZCatalog Searching HowTo), but it should work. --RDM
participants (2)
-
Peter Arvidsson -
R. David Murray