[CMF-checkins] CVS: Products/CMFDefault - DiscussionItem.py:1.22

Tres Seaver tseaver@zope.com
Mon, 3 Dec 2001 12:19:04 -0500


Update of /cvs-repository/Products/CMFDefault
In directory cvs.zope.org:/tmp/cvs-serv19317

Modified Files:
	DiscussionItem.py 
Log Message:
 - Add 'DiscussionItemContainer.getReply'.

=== Products/CMFDefault/DiscussionItem.py 1.21 => 1.22 ===
         return self.id
 
+    security.declareProtected( CMFCorePermissions.View, 'getReply' )
+    def getReply( self, reply_id ):
+        """
+            Return a discussion item, given its ID;  raise KeyError
+            if not found.
+        """
+        return self._container.get( reply_id ).__of__(self)
+
     # Is this right?
     security.declareProtected( CMFCorePermissions.View, '__bobo_traverse__' )
     def __bobo_traverse__(self, REQUEST, name):
@@ -191,7 +199,7 @@
 
         else:
             try:
-                return self._container.get(name).__of__(self)
+                return self.getReply(name)
             except:
                 parent = aq_parent( aq_inner( self ) )
                 if parent.getId() == name: