def _helper(item, value): if field is None: return '' obj = item.getObject() if isdate: raw_date = obj.get_header(field) raw_date = re.sub(r'\((.*)\)', '\g<1>', raw_date) try: date = DateTime(raw_date) except SyntaxError: return '' return helper.readable_date_time_text(item, date) elif field == 'attachments': imgpath = '++resource++attachment.png' return '<img src="%s" alt="%s" /> %s' % ( imgpath, translate(_(u'attachment_icon_alt_text', default=u'Attachment'), context=obj.REQUEST), len(obj.attachment_infos)) else: return obj.get_header(field)
def _helper(item, value): if field is None: return '' obj = item.getObject() if isdate: date = obj.get_header(field, isdate) return helper.readable_date_time_text(item, date) elif field == 'attachments': imgpath = '++resource++attachment.png' return '<img src="%s" alt="%s" /> %s' % ( imgpath, translate(_(u'attachment_icon_alt_text', default=u'Attachment'), context=obj.REQUEST), len(obj.attachment_infos)) else: return obj.get_header(field)
def title(self): default_title = _(u'no_subject', default=u'[No Subject]') return getattr(self, '_title', default_title)