Here's the fulltext() method I'm using at present (i.e. this is where I'm
starting from):
def _stringify(self, obj):
if not isinstance(obj, basestring):
try:
obj = str(obj)
except UnicodeEncodeError:
obj = unicode(obj)
return obj
security.declareProtected(SilvaPermissions.AccessContentsInformation, 'fulltext')
def fulltext(self):
"""Return the full text content of this object."""
if self.version_status() == 'unapproved':
return ''
fulltext = [self.get_title()]
text = self._flattenxml(self.content_xml())
if isinstance(text, (list, tuple, )): fulltext.extend(map(self._stringify, filter(None, text)))
else:
text = self._stringify(text)
if text: fulltext.append(text)
return fulltext
O.K.
Here's the fulltext() method I'm using at present (i.e. this is where I'm
starting from):
def _stringify(self, obj):
if not isinstance(obj, basestring):
try:
obj = str(obj)
except UnicodeEncodeError:
obj = unicode(obj)
return obj
security. declareProtecte d(SilvaPermissi ons.AccessConte ntsInformation,
'fulltext' ) status( ) == 'unapproved': l(self. content_ xml())
fulltext. extend( map(self. _stringify, filter(None, text))) (text)
fulltext. append( text)
def fulltext(self):
"""Return the full text content of this object."""
if self.version_
return ''
fulltext = [self.get_title()]
text = self._flattenxm
if isinstance(text, (list, tuple, )):
else:
text = self._stringify
if text:
return fulltext