[Zope-CMF] Re: PROPOSAL: implement synContentValues in CMFTopic
Michael Haubenwallner
michael at d2m.at
Mon Jun 7 14:01:46 EDT 2004
Tres Seaver wrote:
> Petri Savolainen wrote:
>
>> Oh well. The following:
>>
>>
>>> def synContentValues(self):
>>> return [result for result in self.queryCatalog()]
>>
>>
>>
>> Should of course be:
>>
>> def synContentValues(self):
>> return [result.getObject() for result in self.queryCatalog()]
>>
>>
>> Sorry for the mistake. Any other gotchas I missed?
>
>
> We *really* don't want to call 'getObject' on each brain of an
> arbitrarily long catalog query result set. So, we should probably do
> something like:
>
> def synContentValues( self ):
>
> """ See Syndicatable.
> """
> syn_tool = getToolByName( self, 'portal_syndication' )
> limit = syn_tool.getMaxItems( self )
> brains = self.queryCatalog( sort_limit=limit )[ :limit ]
> return [ brain.getObject() for brain in brains ]
>
> Please submit your feature request at the CMF collector:
>
> http://zope.org/Collectors/CMF
>
> Tres.
this has already happend in november last year
http://zope.org/Collectors/CMF/203
i am fine with just returning the brains though (you can get the objects
at display time).
i'd be glad if you could include it with some of the next releases.
--
michael
More information about the Zope-CMF
mailing list