This commit is contained in:
Katja Süss
2017-07-28 19:12:49 +00:00
committed by ksuess
parent fb7c68d5e5
commit 78abff152d
16 changed files with 140 additions and 77 deletions
+31 -23
View File
@@ -77,8 +77,10 @@ def creator(object):
@indexer(IComment)
def description(object):
# Return the first 25 words of the comment text and append ' [...]'
text = join(object.getText(
targetMimetype='text/plain').split()[:MAX_DESCRIPTION])
text = join(
object.getText(targetMimetype='text/plain')
.split()[:MAX_DESCRIPTION]
)
if len(object.getText().split()) > 25:
text += ' [...]'
return text
@@ -99,37 +101,43 @@ def in_response_to(object):
@indexer(IComment)
def effective(object):
# the catalog index needs Zope DateTime instead of Python datetime
return DateTime(object.creation_date.year,
object.creation_date.month,
object.creation_date.day,
object.creation_date.hour,
object.creation_date.minute,
object.creation_date.second,
'GMT')
return DateTime(
object.creation_date.year,
object.creation_date.month,
object.creation_date.day,
object.creation_date.hour,
object.creation_date.minute,
object.creation_date.second,
'GMT',
)
@indexer(IComment)
def created(object):
# the catalog index needs Zope DateTime instead of Python datetime
return DateTime(object.creation_date.year,
object.creation_date.month,
object.creation_date.day,
object.creation_date.hour,
object.creation_date.minute,
object.creation_date.second,
'GMT')
return DateTime(
object.creation_date.year,
object.creation_date.month,
object.creation_date.day,
object.creation_date.hour,
object.creation_date.minute,
object.creation_date.second,
'GMT',
)
@indexer(IComment)
def modified(object):
# the catalog index needs Zope DateTime instead of Python datetime
return DateTime(object.modification_date.year,
object.modification_date.month,
object.modification_date.day,
object.modification_date.hour,
object.modification_date.minute,
object.modification_date.second,
'GMT')
return DateTime(
object.modification_date.year,
object.modification_date.month,
object.modification_date.day,
object.modification_date.hour,
object.modification_date.minute,
object.modification_date.second,
'GMT',
)
# Override the conversation indexers for comments