コード例 #1
0
 def col_defs(self):
     return [
         IdCol(self, 'id'),
         Col(self, 'name', sTitle='Title'),
         Col(self, 'description', sTitle='Abstract'),
         SourcesCol(self, 'sources', bSearchable=False, bSortable=False)
     ]
コード例 #2
0
ファイル: datatables.py プロジェクト: MacyL/lexibank
 def col_defs(self):
     return [
         IdCol(self, 'id'),
         LinkCol(self, 'name'),
         Col(self, 'cognates', model_col=Cognateset.representation),
         ProviderCol(self, 'provider', get_object=lambda i: i.contribution),
     ]
コード例 #3
0
ファイル: datatables.py プロジェクト: clld/crossgram
 def col_defs(self):
     return [
         IdCol(self, 'id'),
         LinkCol(self, 'name'),
         LinkToMapCol(self, 'm'),
         ContributionsCol(self, 'contributions')
     ]
コード例 #4
0
 def col_defs(self):
     return [
         LinkCol(self, 'Name', model_col=lsiLanguage.name),
         IdCol(self, 'ISO-639-3', sClass='left', model_col=lsiLanguage.id),
         FamilyLinkCol(self, 'Family', language_cls=lsiLanguage),
         MacroareaCol(self, 'Macro_Area', language_cls=lsiLanguage),
         Col(self, 'Features', model_col=lsiLanguage.representation),
         LinkToMapCol(self, 'm'),
     ]
コード例 #5
0
ファイル: datatables.py プロジェクト: MacyL/lexibank
 def col_defs(self):
     return [
         IdCol(self, 'id'),
         LinkCol(self, 'name', sTitle='Concept'),
         Col(self, 'Languages', model_col=Concept.representation),
         Col(self,
             'semantic_field',
             model_col=Concept.semanticfield,
             choices=get_distinct_values(Concept.semanticfield)),
         ConcepticonLink(self, 'Concepticon'),
     ]
コード例 #6
0
 def col_defs(self):
     return [
         DetailsRowLinkCol(self),
         IdCol(self, 'id'),
         LinkCol(self, 'name'),
         LinkToMapCol(self),
         Col(self,
             'latitude',
             sDescription='<small>The geographic latitude</small>'),
         Col(self, 'longitude'),
     ]
コード例 #7
0
 def col_defs(self):
     return [
         Col(self, 'pk'),
         DetailsRowLinkCol(self, 'd'),
         LinkToMapCol(self, 'm'),
         LinkCol(self, 'link'),
         Col(self, 'active'),
         Col(self, 'name', model_col=None),
         Col(self, 'description', format=lambda i: 'x'),
         IntegerIdCol(self, 'id'),
         IdCol(self, 'nid',
               get_object=lambda i: i, model_col=common.Contributor.id),
         ExternalLinkCol(self, 'url')]
コード例 #8
0
ファイル: datatables.py プロジェクト: clld/tsammalex
 def col_defs(self):
     return [
         IdCol(self, 'id', sTitle='Code'),
         LinkCol(self, 'name'),
         BiomeCol(self, 'category'),
         Col(self,
             'status',
             sDescription=Ecoregion.gbl_stat.doc,
             model_col=Ecoregion.gbl_stat,
             choices=get_distinct_values(Ecoregion.gbl_stat)),
         LinkToMapCol(self, 'm', sTitle=''),
         Col(self,
             'w',
             sTitle='',
             format=lambda i: external_link(i.wwf_url(), 'WWF'))
     ]
コード例 #9
0
ファイル: datatables.py プロジェクト: lessersunda/lexirumah
 def col_defs(self):
     return [
         IdCol(self, 'id'),
         LinkCol(self, 'reference'),
         #Col(self, 'description', model_col=Contribution.description),
         Col(self, 'language_count', sTitle='# lects', model_col=Provider.language_count),
         Col(self, 'parameter_count', sTitle='# concepts', model_col=Provider.parameter_count),
         Col(self,
             'lexeme_count',
             sTitle='# lexemes',
             model_col=Provider.lexeme_count,
             format=lambda i: '{:,}'.format(i.lexeme_count)),
         Col(self,
             'synonymy',
             sDescription=Provider.synonym_index.doc,
             model_col=Provider.synonym_index,
             format=lambda i: '{:.3f}'.format(i.synonym_index))
     ]
コード例 #10
0
ファイル: datatables.py プロジェクト: clld/hindukush
 def col_defs(self):
     if self.contribution:
         if self.contribution.id == 'StructureDataset':
             return [
                 IdCol(self, 'id'),
                 LinkCol(self, 'name'),
                 category_col(self),
                 DetailsRowLinkCol(self, '#', button_text='values'),
             ]
         elif self.contribution.id == 'Wordlist':
             return [
                 ParameterNameCol(self, 'name'),
                 ConcepticonCol(self, 'concepticon'),
                 Col(self,
                     'category',
                     model_col=models.Param.category,
                     choices=models.Param.get_categories(
                         self.contribution)),
             ]
     return Parameters.col_defs(self)
コード例 #11
0
ファイル: datatables.py プロジェクト: Maggi12/wals3
 def col_defs(self):
     return [
         LinkCol(self, 'name'),
         IdCol(self, 'id', sTitle='WALS code', sClass='left'),
         Col(self,
             'iso_codes',
             sTitle='ISO 639-3',
             model_col=WalsLanguage.iso_codes),
         LinkCol(self,
                 'genus',
                 model_col=Genus.name,
                 get_object=lambda i: i.genus),
         LinkCol(self,
                 'family',
                 model_col=Family.name,
                 get_object=lambda i: i.genus.family),
         Col(self,
             'macroarea',
             model_col=WalsLanguage.macroarea,
             choices=get_distinct_values(WalsLanguage.macroarea)),
         Col(self, 'latitude'),
         Col(self, 'longitude'),
         CountriesCol(self, 'countries'),
     ]
コード例 #12
0
 def col_defs(self):
     if self.analysis:
         res = [
             LinkCol(self,
                     'parameter',
                     get_object=lambda i: i.unitparameter,
                     model_col=common.UnitParameter.name),
         ]
     elif self.unitparameter:
         res = [
             IdCol(self,
                   'sample',
                   get_object=lambda i: i.analysis.sample,
                   model_col=common.Value.id)
         ]
     else:
         res = []
     res.append(ValueCol(self, 'value'))
     res.append(PrecisionCol(self, 'precision', sTitle='Value SD'))
     res.append(SigmaCol(self, 'sigma', sTitle='SD Sigma'))
     #if self.analysis:
     #    res.append(StatsCol(self, 'stats'))
     res.append(DetailsRowLinkCol(self, 'method', button_text='method'))
     return res
コード例 #13
0
 def col_defs(self):
     return [
         IdCol(self, 'id'),
         LinkCol(self, 'name'),
     ]
コード例 #14
0
 def col_defs(self):
     return [
         IdCol(self, 'id'),
         LinkCol(self, 'name'),
         GlottologUrlCol(self, 'description', sTitle='Glottolog'),
     ]
コード例 #15
0
ファイル: datatables.py プロジェクト: HedvigS/grambank
    def col_defs(self):
        name_col = ValueNameCol(self, 'value')
        if self.parameter and self.parameter.domain:
            name_col.choices = [(de.name, de.description)
                                for de in self.parameter.domain]

        cols = []
        if self.parameter:
            cols = [
                LinkCol(self,
                        'Name',
                        model_col=common.Language.name,
                        get_object=lambda i: i.valueset.language),
                Col(self,
                    'Glottocode',
                    model_col=common.Language.id,
                    get_object=lambda i: i.valueset.language),
                LinkCol(
                    self,
                    'Contributor',
                    model_col=common.Contributor.name,
                    get_object=lambda i: i.valueset.contribution.
                    contributor_assocs[0].contributor,
                )
            ]
        elif self.language:
            cols = [
                IdCol(self,
                      'Feature Id',
                      sClass='left',
                      model_col=common.Parameter.id,
                      get_object=lambda i: i.valueset.parameter),
                LinkCol(self,
                        'Feature',
                        model_col=common.Parameter.name,
                        get_object=lambda i: i.valueset.parameter)
            ]
        elif self.family:
            cols = [
                LinkCol(self,
                        'Name',
                        model_col=common.Language.name,
                        get_object=lambda i: i.valueset.language)
            ]
            if not self.feature:
                cols.extend([
                    IdCol(self,
                          'Feature Id',
                          sClass='left',
                          model_col=common.Parameter.id,
                          get_object=lambda i: i.valueset.parameter),
                    LinkCol(
                        self,
                        'Feature',
                        model_col=common.Parameter.name,
                        get_object=lambda i: i.valueset.parameter,
                        choices=get_distinct_values(common.Parameter.name),
                    )
                ])

        cols = cols + [
            name_col,
            RefsCol(self,
                    'Source',
                    model_col=common.ValueSet.source,
                    get_object=lambda i: i.valueset),
            Col(self, 'Comment', model_col=common.Value.description),
            #Col(self, 'Contributed By', model_col=common.Contribution.name,
            #        get_object=lambda i: i.valueset.contribution)
        ]
        return cols