[Zope-CMF] RE: Finding all syndication enabled folders

vsbabu@vsbabu.org vsbabu@vsbabu.org
Wed, 29 May 2002 06:05:52 -0500


>> Never mind, it was a simple matter using portal_catalog.
>> ##
>> results = []
>> for r in context.portal_catalog({'Type':['Folder']}):
>>    o = r.getObject()
>>    if 1==context.portal_syndication.isSyndicationAllowed(o):
>>        results.append(o)
>> return results
>> ##
>
><teaching granny to suck eggs>
>
>If your Folders are already cataloged, it might be worth adding
>'isSyndicationAllowed' to the catalog metadata, otherwise you're doing a
>getObject on every Folder in your site, which is pretty expensive?
>
></teaching granny to suck eggs>

Right. isSyndicationAllowed is a method, so I'm not sure this can be added to the catalog. I'd say the fastest and least expensive method is to add this (or the equivalent property - need to find out what it is) to the catalog *index* and then search like 

return context.portal_catalog({'Tyoe':['Folder'],'isSyndicationAllowed':1})

to get a list of catalog records.

Thanks Jon

- vsb