[Zope-CMF] Finding all syndication enabled folders

Jon Edwards jon@pcgs.freeserve.co.uk
Tue, 28 May 2002 19:26:09 +0100


> 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>

HTH :-)

Cheers, Jon