[Zope] Iterating descendants of base Z Class, how?

Alexander Staubo alex@mop.no
Wed, 9 Jun 1999 20:19:47 +0200


Oh yeah, and I can do

<!--#in "objectValues('Project') + objectValues('WebProject')"-->

but while this is cool (it's what I'm using now), it's still pretty
inflexible.

--
Alexander Staubo             http://www.mop.no/~alex/
"`Ford, you're turning into a penguin. Stop it.'"
--Douglas Adams, _The Hitchhiker's Guide to the Galaxy_

>-----Original Message-----
>From: Alexander Staubo [mailto:alex@mop.no]
>Sent: 9. juni 1999 20:19
>To: Zope Mailing List (E-mail)
>Subject: [Zope] Iterating descendants of base Z Class, how?
>
>
>Let's say I have a base Z Class "Project". Then I have a descendant Z
>Class "WebProject". Is there a way to get a list of a folder's objects
>that are project objects or descendants?
>
>For example,
>
><!--#in "objectValues('Project')"-->
>...
>
>will only give me instances of the base class Project, _not_ any
>WebProject instances. In order to do both, I have to do
>
><!--#in "objectValues('Project')"-->
>...
><!--#/in-->
><!--#in "objectValues('WebProject')"-->
>...
><!--#/in-->
>
>But while this works, it's pretty inflexible, especially as I intend
>invent new subclasses of Project, and I do not wish to rewrite
>this DTML
>code every time I do.
>
>I realize I can possibly enumerate the meta types through the Control
>Panel, and then do objectValues() on each of the class names, but this
>smells like a bitch job.
>
>--
>Alexander Staubo             http://www.mop.no/~alex/
>"`Ford, you're turning into a penguin. Stop it.'"
>--Douglas Adams, _The Hitchhiker's Guide to the Galaxy_
>
>
>_______________________________________________
>Zope maillist  -  Zope@zope.org
>http://www.zope.org/mailman/listinfo/zope
>
>(For developer-specific issues, use the companion list,
>zope-dev@zope.org - http://www.zope.org/mailman/listinfo/zope-dev )
>