fix for "TypeError: can't pickle OIBTreeItems objects".
svn path=/plone.app.discussion/trunk/; revision=27778
This commit is contained in:
		
							parent
							
								
									d7bbee3a99
								
							
						
					
					
						commit
						41010fb32a
					
				@ -36,7 +36,7 @@ def last_comment_date(object):
 | 
			
		||||
@indexer(IContentish, IZCatalog)
 | 
			
		||||
def commentators(object):
 | 
			
		||||
    conversation = IConversation(object)
 | 
			
		||||
    return conversation.commentators
 | 
			
		||||
    return tuple(set(conversation.commentators.keys()))
 | 
			
		||||
 | 
			
		||||
# Comment Indexers
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -167,7 +167,7 @@ class Conversation(Traversable, Persistent, Explicit):
 | 
			
		||||
 | 
			
		||||
    @property
 | 
			
		||||
    def commentators(self):
 | 
			
		||||
        return self._commentators.keys()
 | 
			
		||||
        return self._commentators
 | 
			
		||||
 | 
			
		||||
    def objectIds(self):
 | 
			
		||||
        return self._comments.keys()
 | 
			
		||||
@ -255,6 +255,10 @@ class Conversation(Traversable, Persistent, Explicit):
 | 
			
		||||
        notify(ObjectAddedEvent(comment.__of__(self), self, id))
 | 
			
		||||
        notify(ContainerModifiedEvent(self))
 | 
			
		||||
 | 
			
		||||
        # XXX: This shouldn't be necessary.
 | 
			
		||||
        content_obj = aq_parent(self)
 | 
			
		||||
        content_obj.reindexObject()
 | 
			
		||||
 | 
			
		||||
        return id
 | 
			
		||||
 | 
			
		||||
    # Dict API
 | 
			
		||||
 | 
			
		||||
@ -422,6 +422,8 @@ class ConversationTest(PloneTestCase):
 | 
			
		||||
        # object, as we just want to check the Conversation object API.
 | 
			
		||||
        conversation = IConversation(self.portal.doc1)
 | 
			
		||||
 | 
			
		||||
        self.assertEquals(conversation.total_comments, 0)
 | 
			
		||||
 | 
			
		||||
        # Add a four comments from three different users
 | 
			
		||||
        # Note: in real life, we always create
 | 
			
		||||
        # comments via the factory to allow different factories to be
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user