[Zope] Count of folders within another folder?

michel@digicool.com michel@digicool.com
29 Jun 1999 23:38:50 -0400


Alexander Staubo <alex@mop.no> writes:

> This works:
> 
> 	<!--#var "_.len(objectValues('Folder'))"-->
> 
> Note that this won't automagically include folder-like products or Z
> Classes descended from Object Manager. There's no objectValues() that
> has isinstance() behaviour (yet). So if you have any such objects, the
> most convenient way to do it right now is:
> 
> 	<!--#var "_.len(objectValues(['Folder', 'MyFolderType']))"-->
> 

Note that I belive if you create a 'Base' ZClass with Meta Type
'myBaseClass' and you derive 'Sub' ZClasses from myBaseClass, but
don't specify a meta type, then the subclasses will inherit the common 
meta type.

Not quite as flexible as an isinstance() method, but could be handy.

-Michel