Test
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user