fix indexing bug: text attribute must return empty string, not None

git-svn-id: svn://svn.cy55.de/Zope3/src/loops/trunk@1347 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
helmutm 2006-09-17 11:25:15 +00:00
parent 8cd89c7ff1
commit ab707787fb
2 changed files with 4 additions and 4 deletions

View file

@ -317,8 +317,8 @@ Index attributes adapter
>>> from loops.resource import IndexAttributes
>>> idx = IndexAttributes(doc1)
>>> idx.text() is None
True
>>> idx.text()
''
>>> idx.title()
u'doc1 Zope Info'

View file

@ -237,7 +237,7 @@ class IndexAttributes(object):
def text(self):
context = self.context
if not context.contentType.startswith('text'):
return None
return ''
data = context.data
# TODO: transform to plain text
#return ' '.join((zapi.getName(context), context.title, data)).strip()
@ -249,7 +249,7 @@ class IndexAttributes(object):
class IndexableResource(object):
""" Used for TextIndexNG.
""" Used for TextIndexNG - obsolete.
"""
implements(IIndexableContent)