I am successfully using <dtml-in "subdir.objectValues()"> .... </dtml-in> now I wanted to do something like <dtml-in "subdir.objectValues('*_de')> i.e. only select objects from the subfolder with a name ending in "_de" how can this be done - I can not find any hint within the Zope docs/howtos :(((( Thanks Kai -- Institut für Seeverkehrswirtschaft und Logistik http://www.isl.org/ Dipl.-Inform. Kai Hofmann mailto:hofmann@isl.org Universitaetsallee GW1 Block A phone:+49 421 22096-83 D-28359 Bremen fax:+49 421 22096-55
On Wed, 2 May 2001, Kai Hofmann wrote:
I am successfully using
<dtml-in "subdir.objectValues()"> .... </dtml-in>
now I wanted to do something like
<dtml-in "subdir.objectValues('*_de')>
i.e. only select objects from the subfolder with a name ending in "_de" how can this be done - I can not find any hint within the Zope docs/howtos :((((
objectValues accepts a list of meta types to search for, but not a pattern, e.g.: objectValues(['Folder', 'Image']) is accepted. what you have to do is something like: <UNTESTED> <dtml-in "subdir.objectValues()"> <dtml-if "_['sequence-item'].getId()[-3:] == '_de'"> do_something </dtml-if> </dtml-in> </UNTESTED> hoping this helps Jerome Alet
Hi Jerome,
<UNTESTED> <dtml-in "subdir.objectValues()"> <dtml-if "_['sequence-item'].getId()[-3:] == '_de'"> do_something </dtml-if> </dtml-in> </UNTESTED>
_['sequence-item'].getId() results in an error: "string object has no attribute getId" :( -- Institut für Seeverkehrswirtschaft und Logistik http://www.isl.org/ Dipl.-Inform. Kai Hofmann mailto:hofmann@isl.org Universitaetsallee GW1 Block A phone:+49 421 22096-83 D-28359 Bremen fax:+49 421 22096-55
On Wed, 2 May 2001, Kai Hofmann wrote:
<UNTESTED> <dtml-in "subdir.objectValues()"> <dtml-if "_['sequence-item'].getId()[-3:] == '_de'"> do_something </dtml-if> </dtml-in> </UNTESTED>
_['sequence-item'].getId() results in an error: "string object has no attribute getId"
Sorry, but this was said as being UNTESTED. the following works: <dtml-if "getId()[-3:] == '_de'"> do_something </dtml-if> bye, Jerome Alet
Hi Kai, haha :) The argument of objectValues() refers to meta_types rather then to objectids. What you can do is: <dtml-in "subdir.objectValues()"> <dtml-if "id()[-3:]=='_de'> render whatever </dtml-if ends with _de> </dtml-in objectValues> Or - more advanced - use the ZCatalog for this, so you would get easyness and performance the same time :-) Tino Wildenhain --On Mittwoch, 2. Mai 2001 10:02 +0200 Kai Hofmann <hofmann@isl.org> wrote:
I am successfully using
<dtml-in "subdir.objectValues()"> .... </dtml-in>
now I wanted to do something like
<dtml-in "subdir.objectValues('*_de')>
i.e. only select objects from the subfolder with a name ending in "_de" how can this be done - I can not find any hint within the Zope docs/howtos :((((
Thanks
Kai
-- Institut für Seeverkehrswirtschaft und Logistik http://www.isl.org/ Dipl.-Inform. Kai Hofmann mailto:hofmann@isl.org Universitaetsallee GW1 Block A phone:+49 421 22096-83 D-28359 Bremen fax:+49 421 22096-55
_______________________________________________ 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 (3)
-
Jerome Alet -
Kai Hofmann -
Tino Wildenhain