From ab707787fb80db6d3b0e55fc5ecf50a438a31887 Mon Sep 17 00:00:00 2001 From: helmutm Date: Sun, 17 Sep 2006 11:25:15 +0000 Subject: [PATCH] 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 --- README.txt | 4 ++-- resource.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.txt b/README.txt index 1bb2288..46fe4c7 100755 --- a/README.txt +++ b/README.txt @@ -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' diff --git a/resource.py b/resource.py index e8b6dbd..b251565 100644 --- a/resource.py +++ b/resource.py @@ -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)