예제 #1
0
    def col_defs(self):
        cols = [DetailsRowLinkCol(self, 'd', button_text='citation')]
        if self.provider:
            cols.append(BibkeyCol(self, 'key'))
        cols.extend([
            LinkCol(self, 'name'),
            Col(self, 'description', sTitle='Title'),
            FtsCol(self, 'fts', model_col=Ref.fts),
            CaCol(self, 'ca_language'),
        ])

        if not self.complexquery:
            cols.append(Col(self, 'year', model_col=Source.year_int))
            cols.append(Col(self, 'pages', model_col=Source.pages_int))

        cols.append(DoctypeCol(self, 'doctype'))
        cols.append(CaCol(self, 'ca_doctype'))
        if not self.provider:
            cols.append(ProviderCol(self, 'provider'))
        if self.language:
            cols.append(DirectAssignmentCol(
                self, 'd',
                sTitle='da',
                sDescription="Signals whether the reference is directly assigned to this languoid or inherited from daughter languoids.",
                bSortable=False,
                bSearchable=False))
        return cols
예제 #2
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)
     ]
예제 #3
0
 def col_defs(self):
     return [
         Col(self, 'id'),
         Col(self, 'name'),
         RefCountCol(self, 'refs', bSortable=False, bSearchable=False),
         Col(self, 'description'),
     ]
예제 #4
0
 def col_defs(self):
     res = [
         ConceptIdCol(self, 'id', sClass='left'),
     ]
     if self.parameter:
         res.extend([
             Col(self, 'name', sTitle='Concept in source'),
             Col(self, 'description', sTitle='English gloss'),
             LinkCol(self,
                     'conceptlist',
                     get_object=lambda v: v.valueset.contribution),
         ])
     elif self.contribution:
         #
         # TODO: join Value_data for each source language!
         #
         for lang, alias in self._langs.items():
             res.append(ConceptInSourceCol(self, lang, alias=alias))
         res.append(Col(self, 'description', sTitle='English gloss'))
         res.append(
             LinkCol(self,
                     'concept_set',
                     model_col=Parameter.name,
                     get_object=lambda v: v.valueset.parameter))
     else:
         res.extend([
             Col(self, 'name', sTitle='Description in source'),
             Col(self, 'description', sTitle='English gloss'),
             LinkCol(self,
                     'concept_set',
                     model_col=Parameter.name,
                     get_object=lambda v: v.valueset.parameter),
         ])
     return res
예제 #5
0
 def col_defs(self):
     res = [
         SampleIdCol(self, 'sample', model_col=common.Value.id),
         Col(self, 'artefact', model_col=models.Sample.artefact_id),
     ]
     if not self.parameter:
         res.append(
             CategoryCol(self,
                         'type',
                         choices=get_distinct_values(
                             common.DomainElement.name),
                         model_col=common.DomainElement.name))
     if self.parameter:
         res.append(
             LinkCol(self,
                     'contribution',
                     get_object=lambda v: v.valueset.contribution))
     if self.contribution:
         pass
     if not self.language:
         res.extend([
             RegionCol(self,
                       'region',
                       choices=get_distinct_values(models.Location.region)),
             SubRegionCol(self, 'subregion'),
             Col(self,
                 'site',
                 model_col=models.Sample.site_name,
                 choices=get_distinct_values(models.Sample.site_name)),
         ])
     return res
예제 #6
0
 def col_defs(self):
     from clld.web.datatables.contribution import ContributorsCol, CitationCol
     return [
         Col(self,
             'number',
             sTitle='number',
             model_col=Dictionary.number,
             input_size='mini'),
         LinkCol(
             self,
             'dictionary',
             sTitle='dictionary'),
         ContributorsCol(
             self,
             name='author',
             sTitle='author'),
         Col(self,
             'entries',
             sTitle='entries',
             sClass='right',
             model_col=Dictionary.count_words),
         YearCol(
             self,
             'year',
             bSearchable=False,
             sTitle='year',
             model_col=Dictionary.published),
         CitationCol(self, 'cite', sTitle='cite'),
     ]
예제 #7
0
 def col_defs(self):
     return [
         NumeralParameterCol(
             self,
             "numeral",
             model_col=Parameter.name,
         ),
         Col(
             self,
             "count_of_datapoints",
             sTitle='Number of data points',
             sTooltip='number of data points per numeral',
             model_col=NumberParameter.count_of_datapoints,
         ),
         Col(
             self,
             "count_of_varieties",
             sTitle='Number of distinct varieties',
             sTooltip=
             'number of distinct varieties based on assigned Glottocodes',
             model_col=NumberParameter.count_of_varieties,
         ),
         NumberConcepticonCol(
             self,
             "concepticon_id",
             model_col=NumberParameter.concepticon_id,
             sTitle='',
             sWidth=40,
         )
     ]
예제 #8
0
 def col_defs(self):
     return [
         LinkCol(self, 'name'),
         Col(self,
             'experiments',
             model_col=models.Species.count_experiments,
             input_size='mini'),
         GBIFLinkCol(self,
                     'gbif',
                     sTitle='GBIF',
                     model_col=models.Species.gbif_name),
         Col(self,
             'class',
             model_col=models.Species.klass,
             choices=get_distinct_values(models.Species.klass)),
         Col(self,
             'order',
             model_col=models.Species.order,
             choices=get_distinct_values(models.Species.order)),
         Col(self,
             'family',
             model_col=models.Species.family,
             choices=get_distinct_values(models.Species.family)),
         Col(self,
             'genus',
             model_col=models.Species.genus,
             choices=get_distinct_values(models.Species.genus)),
     ]
예제 #9
0
 def col_defs(self):
     base = [
         Col(self, 'id', bSortable=False, input_size='mini'),
         LinkCol(self,
                 'name',
                 sTitle='Primary text',
                 sClass="object-language"),
         TsvCol(self, 'analyzed', sTitle='Analyzed text'),
         TsvCol(self, 'gloss', sClass="gloss"),
         Col(self,
             'description',
             sTitle=self.req.translate('Translation'),
             sClass="translation"),
         DetailsRowLinkCol(self, "d", sTitle="IGT"),
     ]
     if not self.language:
         base.append(
             LinkCol(self,
                     'language',
                     model_col=Language.name,
                     get_obj=lambda i: i.language,
                     bSortable=not self.language,
                     bSearchable=not self.language))
     base.append(RefsCol(self, 'references'))
     return base
예제 #10
0
    def col_defs(self):
        er_col = EcoregionCol(self, 'ecoregions')
        if 'er' in self.req.params:
            er_col.js_args['sFilter'] = self.req.params['er']

        res = [
            LinkCol(self, 'name', sTitle='Taxon'),
            Col(self, 'english_name', model_col=Taxon.english_name),
            ClassificationCol(self,
                              'order',
                              sTitle='Biological classification'),
            ThumbnailCol(self, 'thumbnail'),
            # TODO: second thumbnail?
        ]
        if self.languages:
            for i, lang in enumerate(self.languages):
                res.append(
                    CommonNameCol(self, 'cn%s' % i, lang, self._langs[i]))
            #res.append(_CategoryCol(self, 'categories', self.languages, bSortable=False))
        else:
            res.append(
                Col(self, 'characteristics', model_col=Taxon.characteristics))

        res.extend([er_col, CountriesCol(self, 'countries')])
        # TODO: characteristics col?
        return res
예제 #11
0
 def col_defs(self):
     if self.type == 'families':
         return [
             NameCol(self, 'name'),
             #StatusCol(self),
             LevelCol(self),
             MacroareaCol(self, 'macro-area'),
             Col(self,
                 'child_family_count',
                 model_col=Languoid.child_family_count,
                 sTitle='Sub-families'),
             Col(self,
                 'child_language_count',
                 model_col=Languoid.child_language_count,
                 sTitle='Child languages'),
             #Col(self, 'child_dialect_count', sTitle='Child dialects'),
             FamilyCol(self, 'top-level family'),
         ]
     else:
         return [
             Col(self, 'id', sTitle='Glottocode'),
             NameCol(self, 'name'),
             FamilyCol(self, 'top-level family'),
             IsoCol(self, 'iso', sTitle='ISO-639-3'),
             #StatusCol(self),
             MacroareaCol(self, 'macro-area'),
             Col(self, 'child_dialect_count', sTitle='Child dialects'),
         ]
예제 #12
0
 def col_defs(self):
     return [
         IntegerIdCol(self, 'id'),
         LinkCol(self, 'name', sTitle='Language structure dataset'),
         ContributorsCol(self,
                         'contributors',
                         bSearchable=False,
                         bSortable=False,
                         sTitle='Authors of dataset'),
         Col(self,
             'lexifier',
             choices=get_distinct_values(Lect.lexifier,
                                         key=lambda v: 'z' + v
                                         if v == 'Other' else v),
             get_obj=lambda item: item.language,
             model_col=Lect.lexifier),
         Col(self,
             'region',
             choices=get_distinct_values(Lect.region),
             get_obj=lambda item: item.language,
             model_col=Lect.region),
         CitationCol(self, 'cite', bSearchable=False, bSortable=False),
         IntegerIdCol(self,
                      'survey',
                      get_object=lambda c: c.language.survey,
                      bSearchable=False,
                      bSortable=False,
                      sTitle='Survey'),
     ]
예제 #13
0
 def col_defs(self):
     if self.parameter:
         return [
             LinkCol(self,
                     'sample',
                     model_col=Sample.name,
                     get_object=lambda i: i.valueset.language),
             Col(self,
                 'region',
                 model_col=Sample.region,
                 get_object=lambda i: i.valueset.language,
                 format=lambda i: i.valueset.language.region),
             FamilyCol(self,
                       'family',
                       get_object=lambda i: i.valueset.language.languoid,
                       model_col=Languoid.family_name,
                       choices=get_distinct_values(Languoid.family_name)),
             Col(self, 'value', model_col=Measurement.value),
             LinkToMapCol(self,
                          '#',
                          get_object=lambda i: i.valueset.language),
         ]
     if self.language:
         return [
             LinkCol(self,
                     'measure',
                     model_col=Parameter.name,
                     get_object=lambda i: i.valueset.parameter),
             Col(self,
                 'description',
                 get_object=lambda i: i.valueset.parameter,
                 model_col=Parameter.description),
             Col(self, 'value', model_col=Measurement.value),
         ]
     return Values.col_defs(self)
예제 #14
0
 def col_defs(self):
     return [
         LinkCol(self, 'name'),
         LinkToMapCol(self, '#'),
         Col(self,
             'region',
             model_col=Sample.region,
             choices=get_distinct_values(Sample.region)),
         Col(self, 'location', model_col=Sample.location),
         Col(self,
             'latitude',
             input_size='mini',
             sDescription='<small>The geographic latitude</small>'),
         Col(self,
             'longitude',
             input_size='mini',
             sDescription='<small>The geographic longitude</small>'),
         Col(self,
             'samplesize',
             input_size='mini',
             model_col=Sample.samplesize),
         LangCol(self,
                 'languoid',
                 get_object=lambda i: i.languoid,
                 model_col=Languoid.name),
         FamilyCol(self,
                   'family',
                   get_object=lambda i: i.languoid,
                   model_col=Languoid.family_name,
                   choices=get_distinct_values(Languoid.family_name)),
     ]
예제 #15
0
 def col_defs(self):
     res = []
     if self.language:
         res.extend([
             LinkCol(self,
                     'gloss_en',
                     sTitle=self.req._('English'),
                     model_col=common.Parameter.name,
                     get_object=lambda v: v.valueset.parameter),
         ])
     elif self.parameter:
         res.extend([
             LinkCol(self,
                     'language',
                     sTitle=self.req._('Language'),
                     get_object=lambda v: v.valueset.language),
             Col(
                 self,
                 'desc',
                 sTitle=self.req._('Location'),
                 get_object=lambda v: v.valueset.language,
                 model_col=common.Language.description,
             ),
         ])
         # FIXME: link to map!
     res.append(Col(self, 'name', sTitle=self.req._('Word')))
     res.append(AudioCol(self, '#'))
     return res
예제 #16
0
    def col_defs(self):
        res = []

        if self.language:
            res.extend([
                IntegerIdCol(self,
                             'id',
                             model_col=Concept.id,
                             get_object=lambda x: x.valueset.parameter),
                ConceptLinkCol(self,
                               'concept',
                               model_col=Concept.name,
                               get_object=lambda x: x.valueset.parameter)
            ])

        elif self.parameter:
            res.extend([
                DoculectLinkCol(self,
                                'language',
                                model_col=Doculect.name,
                                get_object=lambda x: x.valueset.language)
            ])

        res.extend([
            Col(self, 'form', model_col=Word.name, sTitle='Orthographic form'),
            Col(self,
                'raw_ipa',
                model_col=Word.raw_ipa,
                sTitle='Automatically generated IPA'),
            # Col(self, 'norm_ipa', model_col=Word.norm_ipa, sTitle='Normalised IPA'),
            NextStepCol(self, 'next_step', model_col=Word.next_step)
        ])

        return res
예제 #17
0
 def col_defs(self):
     return [
         Col(self, 'Designer', model_col=Designer.contributor),
         Col(self, 'Domain of Design', model_col=Designer.domain),
         Col(self, 'Citation', model_col=Designer.citation),
         Col(self, 'More Information', model_col=Designer.pdflink),
     ]
예제 #18
0
 def col_defs(self):
     res = []
     if self.parameter:
         res = [
             LinkCol(self,
                     'language',
                     model_col=Language.name,
                     get_object=lambda i: i.valueset.language),
         ]
     elif self.language:
         res = [
             IntegerIdCol(self,
                          'id',
                          input_size='mini',
                          model_col=Parameter.id,
                          get_object=lambda i: i.valueset.parameter),
             LinkCol(self,
                     'meaning',
                     model_col=Parameter.name,
                     get_object=lambda i: i.valueset.parameter),
         ]
     return res + [
         Col(self, 'name', sTitle='Word', model_col=Value.name),
         Col(self, 'loan', model_col=Word.loan),
     ]
예제 #19
0
파일: datatables.py 프로젝트: oopcode/gld
 def col_defs(self):
     res = [
         Col(self,
             'swadesh_id',
             sTitle='Swadesh ID',
             sDescription="Swadesh ID",
             model_col=Word.swadesh_id),
         Col(self,
             'swadesh_word',
             sTitle='Swadesh Word',
             sDescription="Swadesh Word",
             model_col=Word.swadesh_word),
         Col(self,
             'form',
             sTitle='Form',
             sDescription="Form",
             model_col=Word.form),
         Col(self,
             'cognation_index',
             sTitle='Cognation Index',
             sDescription="Cognation Index",
             model_col=Word.cognation_index),
         Col(self,
             'notes',
             sTitle='Notes',
             sDescription="Notes",
             model_col=Word.notes),
     ]
     return res
예제 #20
0
파일: datatables.py 프로젝트: clld/tppsr
 def col_defs(self):
     return [
         IntegerIdCol(self, 'number'),
         LinkCol(self, 'name'),
         Col(
             self,
             'canton',
             sTitle='Canton',
             model_col=models.Variety.canton,
             choices=get_distinct_values(models.Variety.canton),
         ),
         Col(
             self,
             'group',
             sTitle='Dialect group',
             model_col=models.Variety.group,
             choices=get_distinct_values(models.Variety.group),
         ),
         #Col(self, 'population', model_col=models.Variety.population),
         Col(self,
             'recorded',
             model_col=models.Variety.recorded,
             sTitle='Date of recording'),
         Col(self,
             'latitude',
             sDescription='<small>The geographic latitude</small>'),
         Col(self,
             'longitude',
             sDescription='<small>The geographic longitude</small>'),
         LinkToMapCol(self, 'm'),
     ]
예제 #21
0
 def col_defs(self):
     return [
         LinkCol(self, 'contributor'),
         Col(self, 'description'),
         BaseRefsCol(self, 'sources'),
         Col(self, 'url', format=lambda i: maybe_external_link(i.url)),
     ]
예제 #22
0
    def col_defs(self):
        if self.parameter:
            return [
                InventoryCol(self, 'inventory'),
                Col(self, 'marginal', model_col=Phoneme.marginal),
                Col(self, 'allophones', model_col=Phoneme.allophones),
                LinkCol(self,
                        'language',
                        model_col=Language.name,
                        get_object=lambda i: i.valueset.language),
                RefsCol(self, 'source'),
                LinkToMapCol(self,
                             'm',
                             get_object=lambda i: i.valueset.language),
            ]

        res = super(Phonemes, self).col_defs()[1:]
        if self.contribution:
            param = lambda item: item.valueset.parameter
            return [
                ClassCol(self,
                         'segment_class',
                         Segment.segment_class,
                         get_object=param),
                DatapointCol(self, 'valueset'),
                Col(self, 'marginal', model_col=Phoneme.marginal),
                Col(self, 'allophones', model_col=Phoneme.allophones),
                FrequencyCol(self, 'frequency', get_object=param),
            ]
        return res
예제 #23
0
 def col_defs(self):
     return [
         Col(self, 'grapheme', sTitle='Grapheme'),
         Col(self, 'unicode', sTitle="Unicode"),
         LinkCol(self, 'name'),
         Col(self, 'aliases', sTitle='Aliases'),
         Col(self, 'representation', sTitle='Representation')
     ]
예제 #24
0
 def col_defs(self):
     return [
         LinkCol(self, 'name'),
         Col(self,
             '# of feature lists',
             model_col=models.Metafeature.representation),
         Col(self, 'area'),
     ]
예제 #25
0
 def col_defs(self):
     return [
         ConstructionFeatureIdCol(self, 'Id', sClass='left', model_col=sailsUnitParameter.id),
         LinkCol(self, 'Feature', model_col=sailsUnitParameter.name),
         ConstructionFeatureDomainCol(self, 'Domain'),
         Col(self, '# Constructions', model_col=sailsUnitParameter.nconstructions),
         Col(self, '# Languages', model_col=sailsUnitParameter.nlanguages),
     ]
예제 #26
0
파일: datatables.py 프로젝트: clld/tppsr
    def col_defs(self):
        ps = Col(self,
                 'prosodic_structure',
                 sTitle='Prosodic structure',
                 model_col=models.Form.prosodic_structure)
        if self.parameter:
            ps.choices = sorted((c for c, in DBSession.query(
                models.Form.prosodic_structure).join(common.ValueSet).filter(
                    common.ValueSet.parameter == self.parameter).distinct()
                                 if c),
                                key=lambda s: (len(s), s))

        res = [
            Col(self,
                'description',
                sTitle='TPPSR form',
                sClass="object-language"),
            IPACol(self, 'name', sTitle='IPA form', sClass="ipa-text"),
            Col(self,
                'segments',
                sTitle='Segments',
                model_col=models.Form.segments,
                sClass="ipa-text"),
            ps,
        ]
        if self.parameter:
            return [
                DialectCol(self,
                           'dialect',
                           get_object=lambda i: i.valueset.language,
                           model_col=common.Language.name),
                CantonCol(
                    self,
                    'canton',
                    get_object=lambda i: i.valueset.language,
                    choices=get_distinct_values(models.Variety.canton),
                ),
                LinkToMapCol(
                    self, 'm', get_object=lambda i: i.valueset.language),
            ] + res

        if self.language:
            return res + [
                ConceptCol(self,
                           'parameter',
                           sTitle=self.req.translate('Parameter'),
                           model_col=models.Concept.concepticon_gloss,
                           get_object=lambda i: i.valueset.parameter),
                Col(self,
                    'french',
                    sTitle='French gloss',
                    model_col=models.Concept.french_gloss,
                    get_object=lambda i: i.valueset.parameter),
            ]

        return res + [
            ValueSetCol(self, 'valueset', bSearchable=False, bSortable=False),
        ]
예제 #27
0
 def col_defs(self):
     return [
         LinkCol(self, 'name'),
         Col(self, 'description', sTitle='definition'),
         Col(self, 'GOLD_counterpart'),
         Col(self, 'ISOCAT_counterpart'),
         Col(self, 'defined by', model_col=models.Concept.in_degree),
         Col(self, 'defining', model_col=models.Concept.out_degree),
     ]
예제 #28
0
 def col_defs(self):
     return [
         NameCol(self, 'name', model_col=Language.name, sTitle="Name"),
         IsoCol(self, 'iso', model_col=lotw_devLanguage.iso, sTitle='ISO-639-3'),
         FamilyCol(self, 'family', model_col=lotw_devLanguage.family, sTitle="Family"),
         BranchCol(self, 'branch', model_col=lotw_devLanguage.branch, sTitle="Branch"),
         Col(self, 'latitude'),
         Col(self, 'longitude'),
     ]
예제 #29
0
 def col_defs(self):
     return [
         Col(self, 'pk'),
         DetailsRowLinkCol(self),
         LinkToMapCol(self),
         LinkCol(self, 'link'),
         Col(self, 'active'),
         Col(self, 'name', model_col=None),
         Col(self, 'description')]
예제 #30
0
파일: source.py 프로젝트: gopyruby/clld
 def col_defs(self):
     return [
         DetailsRowLinkCol(self, 'd'),
         LinkCol(self, 'name'),
         Col(self, 'description', sTitle='Title'),
         Col(self, 'year'),
         Col(self, 'author'),
         TypeCol(self, 'bibtex_type'),
     ]