calling properties of ZClasses
Hello list, being (still) a newbie, I cannot find a solution to this: I have a folder "specialoffers", in which there are some ZClass-Objects of type "film" with properties "price" and "filmtitle". I'd like to show a list of _some_ filmtitles (defined in a property of the folder "specialoffers"). For a - probably - better understanding: () folder "specialoffers"- with property validfilms= [token] "flyci spanin" [] ZClass flyci - price = 1000 filmtitle= "Flying Circus" [] ZClass meali - price = 1300 filmtitle= "The meaning of life" [] ZClass spanin - price = 1290 filmtitle= "Spanish Inquisition" [] DTML-document "showvalids_html" Which DTML-commands do I have to use to show just the filmtitles of "flyci" and "spanin"? I've just managed to get this far: <dtml-in validfilms> <br><dtml-var sequence-item> <!-- gives "flyci" and in next loop "spanin" --> <dtml-var objectValues(sequence-item).filmtitle> <!-- doesn't work :-(--> </dtml-in> Hoping that somebody is able to help me on this issue... BTW: Are there any tutorials with a listing of _all_ DTML-commands and functions? The .pdf "Zope Document Template Markup Language Reference" on zope.org doesn't cover all functions, I guess. Martin
The problem is you are looping over your property, validfilms. One crude way involves looping through every one: * untested * <dtml-in "objectValues(['film'])"> <dtml-if "title==flyci or title==spanin"> <dtml-var title> </dtml-if> </dtml-in>
Which DTML-commands do I have to use to show just the filmtitles of "flyci" and "spanin"? I've just managed to get this far:
<dtml-in validfilms> <br><dtml-var sequence-item> <!-- gives "flyci" and in next loop "spanin" --> <dtml-var objectValues(sequence-item).filmtitle> <!-- doesn't work :-(--> </dtml-in>
Hoping that somebody is able to help me on this issue...
BTW: Are there any tutorials with a listing of _all_ DTML-commands and functions? The .pdf "Zope Document Template Markup Language Reference" on zope.org doesn't cover all functions, I guess.
Martin
_______________________________________________ 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 )
participants (2)
-
Andy McKay -
marwin98