remove comment_text index.

svn path=/plone.app.discussion/trunk/; revision=27249
This commit is contained in:
Timo Stollenwerk 2009-05-31 18:14:42 +00:00
parent 5f8acfd805
commit ca7752714b
3 changed files with 4 additions and 28 deletions

View File

@ -12,10 +12,6 @@ from plone.app.discussion.interfaces import IComment
def comment_title(object):
return object.title
@indexer(IComment)
def comment_text(object):
return object.text
@indexer(IComment)
def comment_searchable_text(object):
return object.title, object.text

View File

@ -26,7 +26,7 @@
component=".comment.CommentFactory"
name="plone.Comment"
/>
<!-- Conversations -->
<class class=".conversation.Conversation">
<require interface=".interfaces.IConversation" permission="zope2.View" />
@ -38,13 +38,13 @@
<adapter factory=".conversation.CommentReplies" />
<!-- Event subscribers -->
<subscriber
for="plone.app.discussion.interfaces.IComment
zope.app.container.contained.IObjectAddedEvent"
handler=".comment.notify_workflow"
/>
<subscriber
for="plone.app.discussion.interfaces.IComment
zope.app.container.contained.IObjectAddedEvent"
@ -59,7 +59,6 @@
<!-- adapters for indexes -->
<adapter name="title" factory=".catalog.comment_title" />
<adapter name="text" factory=".catalog.comment_text" />
<adapter name="searchable_text" factory=".catalog.comment_searchable_text" />
</configure>

View File

@ -10,7 +10,7 @@ from plone.indexer import indexer
from zope.component import provideAdapter
from plone.app.discussion.catalog import comment_title, comment_text, comment_searchable_text
from plone.app.discussion.catalog import comment_title, comment_searchable_text
class IndexersTest(PloneTestCase):
@ -42,25 +42,6 @@ class IndexersTest(PloneTestCase):
new_id = conversation.addComment(comment)
self.assertEquals(comment_title(comment)(), 'Comment 1')
def test_comment_text(self):
# Create a conversation. In this case we doesn't assign it to an
# object, as we just want to check the Conversation object API.
conversation = IConversation(self.portal.doc1)
# Pretend that we have traversed to the comment by aq wrapping it.
conversation = conversation.__of__(self.portal.doc1)
# Add a comment. Note: in real life, we always create comments via the factory
# to allow different factories to be swapped in
comment = createObject('plone.Comment')
comment.title = 'Comment 1'
comment.text = 'Comment text'
new_id = conversation.addComment(comment)
self.assertEquals(comment_text(comment)(), 'Comment text')
def test_dates(self):
# created, modified, effective etc
pass