def has_translation(self): title = get_translation('page', 'title', self.id) body = get_translation('page', 'body', self.id) teaser = get_translation('page', 'teaser', self.id) if title or body or teaser: return True return False
def trans_title(self): translation = get_translation('PageLink', 'title', self.id) if translation: return translation elif self.title: return self.title else: for lang, translation in get_translations('PageLink', 'title', self.id).items(): if translation: return translation return ''
def trans_teaser(self): translation = get_translation('Page', 'body', self.id) if translation: return strip_tags(translation)[:400] + '...' elif self.title: return strip_tags(self.body)[:400] + '...' else: for lang, translation in get_translations('Page', 'body', self.id).items(): if translation: return strip_tags(translation)[:400] + '...' return ''
def trans_body(self): translation = get_translation('Page', 'body', self.id) if translation: return translation elif self.title: return self.body else: for lang, translation in get_translations('Page', 'body', self.id).items(): if translation: return translation return ''
def trans_title(self): translation = get_translation('PageCategory', 'title', self.id) if translation: return translation else: return self.title
def trans_only_body(self): translation = get_translation('page', 'body', self.id) if translation: return translation else: return ''
def trans_only_title(self): translation = get_translation('page', 'title', self.id) if translation: return translation else: return ''
def trans_teaser(self): translation = get_translation('page', 'teaser', self.id) if translation: return translation else: return self.teaser