[Zope-CMF] Re: Metatype() standard? - small cleanup proposal

yuppie y.2004_ at wcm-solutions.de
Sun Mar 7 15:33:07 EST 2004


Hi!


Raphael Ritz wrote:
> Well, not really. Methods like 'contentValues/Ids/Items'
> in CMFCore.PortalFolder
> which provide a filtered view on 'objectValues/Ids/Items'
> call these methods from OFS.ObjectManager in which
> 
>     ...
>     if ob['meta_type'] in spec:
>         set.append(ob['id'])
>     ...
> 
> gets called in 'objectIds' as soon as you specify a type/types
> to filter on. From this I figured that meta_type is important
> for content objects too. Maybe this is a bug and 'spec'
> should not be passed to the objectIds call in contentValues/Ids/Items
> but that's what currently happens.

Yes. I think this is a bug.

The 'spec' argument of contentIds, contentValues, contentItems and 
listFolderContents should be marked as deprecated.

All these methods call _filteredItems(), so the filtering based on 
portal_types is done anyway. If 'spec' is not specified, objectIds 
should be called without the 'spec' argument.


Marc Lindahl wrote:
> The interface in portal_types.py does not have getPortalTypeName, but it does have getTypeInfo, which looks like if you pass an object and then access it's Id (e.g. here.portal_type.getTypeInfo(here).getId() ) then you'd get the same thing?

I'd like to add getPortalTypeName() to the interface and mark 
_getPortalTypeName() as an deprecated alias.


If there are no objections I'll soon make these changes in CMF HEAD.

Cheers,
	Yuppie





More information about the Zope-CMF mailing list