[CMF-checkins] CVS: CMF/CMFTopic - Topic.py:1.43
Tres Seaver
tseaver at zope.com
Mon Jun 7 22:41:35 EDT 2004
Update of /cvs-repository/CMF/CMFTopic
In directory cvs.zope.org:/tmp/cvs-serv6538
Modified Files:
Topic.py
Log Message:
- Collector #203: Enable syndication for topics.
- Add simple tests for 'Topic.queryCatalog'.
=== CMF/CMFTopic/Topic.py 1.42 => 1.43 ===
--- CMF/CMFTopic/Topic.py:1.42 Mon Jun 7 22:14:43 2004
+++ CMF/CMFTopic/Topic.py Mon Jun 7 22:41:03 2004
@@ -219,6 +219,19 @@
portal_catalog = getToolByName( self, 'portal_catalog' )
return portal_catalog.searchResults(REQUEST, **kw)
+ security.declareProtected(View, 'synContentValues')
+ def synContentValues( self ):
+
+ """ Return a limited subset of the brains for our query.
+
+ o Return no more brain objects than the limit set by the
+ syndication tool.
+ """
+ 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 ]
+
### Criteria adding/editing/deleting
security.declareProtected(ChangeTopics, 'addCriterion')
def addCriterion( self, field, criterion_type ):
More information about the CMF-checkins
mailing list