[prev in list] [next in list] [prev in thread] [next in thread] 

List:       zope-cmf
Subject:    [Zope-CMF] RE: Finding all syndication enabled folders
From:       vsbabu () vsbabu ! org
Date:       2002-05-29 11:05:52
[Download RAW message or body]

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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic