def col_defs(self): poscol = Col(self, 'part_of_speech', model_col=Word.pos) if self.contribution: pos = sorted((c for c, in DBSession.query(Word.pos) .filter(Word.dictionary_pk == self.contribution.pk) .distinct() if c)) res = [ FtsCol(self, 'fts', sTitle='full entry', model_col=Word.fts), WordCol(self, 'word', sTitle='headword', model_col=common.Unit.name), Col(self, 'part_of_speech', sTitle='part of speech', model_col=Word.pos, choices=pos, format=lambda i: HTML.span(i.pos or '', class_='vocabulary')), MeaningDescriptionCol2(self, 'description', sTitle='meaning description', model_col=common.Unit.description), ] if self.second_tab: for name in self.vars: res.append(CustomCol(self, name, sTitle=name.replace('lang-', ''))) return res else: res.append(Col(self, 'examples', input_size='mini', model_col=Word.example_count)) if self.contribution.semantic_domains: res.append(SemanticDomainCol(self, 'semantic_domain', split(self.contribution.semantic_domains))) if self.contribution.count_audio: res.append(MediaCol(self, 'audio', 'audio', sTitle='')) if self.contribution.count_image: res.append(ThumbnailCol(self, 'image', sTitle='')) #res.append(MediaCol(self, 'image', 'image', sTitle='')) for name in self.vars: col = CustomCol(self, name, sTitle=name.replace('lang-', '')) if name in self.contribution.jsondata['choices']: col.choices = self.contribution.jsondata['choices'][name] res.append(col) return res return [ WordCol(self, 'word'), poscol, Col(self, 'description'), MeaningsCol(self, 'meaning', bSortable=False, sTitle='Comparison meaning'), DictionaryCol(self, 'dictionary'), ]
def col_defs(self): poscol = Col(self, 'part_of_speech', model_col=Word.pos) if self.contribution: pos = sorted((c for c, in DBSession.query(Word.pos) .filter(Word.dictionary_pk == self.contribution.pk) .distinct() if c)) res = [ FtsCol(self, 'fts', sTitle='full entry', model_col=Word.fts), WordCol(self, 'word', sTitle='headword', model_col=common.Unit.name), Col(self, 'part_of_speech', sTitle='part of speech', model_col=Word.pos, choices=pos, format=lambda i: HTML.span(i.pos or '', class_='vocabulary')), Col(self, 'description', sTitle='meaning description', model_col=common.Unit.description), Col(self, 'examples', input_size='mini', model_col=Word.example_count), ] if self.second_tab: for name in self.vars: res.append(CustomCol(self, name, sTitle=name.replace('lang-', ''))) return res if self.contribution.semantic_domains: res.append(SemanticDomainCol(self, 'semantic_domain', split(self.contribution.semantic_domains))) if self.contribution.count_audio: res.append(MediaCol(self, 'audio', 'audio', sTitle='')) if self.contribution.count_image: res.append(ThumbnailCol(self, 'image', sTitle='')) #res.append(MediaCol(self, 'image', 'image', sTitle='')) for name in self.vars: col = CustomCol(self, name, sTitle=name.replace('lang-', '')) if name in self.contribution.jsondata['choices']: col.choices = self.contribution.jsondata['choices'][name] res.append(col) return res return [ WordCol(self, 'word'), poscol, Col(self, 'description'), MeaningsCol(self, 'meaning', bSortable=False, sTitle='Comparison meaning'), DictionaryCol(self, 'dictionary'), ]
def semantic_domain_list(self): if self.semantic_domain: return split(self.semantic_domain) return []
def reverse_list(self): return split(self.reverse or '')
def comparison_meanings_list(self): return split(self.comparison_meanings)
def description_list(self): return split(self.description)