Beispiel #1
0
 def col_defs(self):
     return [
         IdCol(self, 'id'),
         LinkCol(self, 'name'),
         LinkToMapCol(self, 'm'),
         ContributionsCol(self, 'contributions')
     ]
Beispiel #2
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)),
     ]
Beispiel #3
0
    def col_defs(self):
        refs_col = RefsCol(self, 'references')
        res = [DetailsRowLinkCol(self, 'd')]
        get = lambda what, i: getattr(i, {'p': 'parameter', 'l': 'language'}[what])

        if self.parameter:
            return res + [
                LinkCol(self, 'language',
                        model_col=Language.name, get_obj=partial(get, 'l')),
                refs_col,
                LinkToMapCol(self, 'm', get_obj=partial(get, 'l')),
            ]

        if self.language:
            return res + [
                LinkCol(self, 'parameter',
                        model_col=Parameter.name, get_obj=partial(get, 'p')),
                refs_col,
            ]

        return res + [
            LinkCol(self, 'language', model_col=Language.name, get_obj=partial(get, 'l')),
            LinkCol(
                self, 'parameter', model_col=Parameter.name, get_obj=partial(get, 'p')),
            refs_col,
        ]
Beispiel #4
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)
Beispiel #5
0
    def col_defs(self):
        if self.parameter:
            return [
                InventoryCol(self, 'inventory'),
                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 [
                DatapointCol(self, 'valueset'),
                FrequencyCol(self, 'frequency', get_object=param),
                ClassCol(self,
                         'segment_class',
                         Segment.segment_class,
                         get_object=param),
                ClassCol(self,
                         'combined_class',
                         Segment.combined_class,
                         get_object=param)
            ]
        return res
Beispiel #6
0
 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'),
     ]
Beispiel #7
0
    def col_defs(self):
        if self.parameter:
            return [
                LinkCol(self,
                        'language',
                        model_col=common.Language.name,
                        get_object=lambda i: i.valueset.language),
                Col(self, 'name', sTitle='Orthography'),
                Col(self, 'description', sTitle='IPA'),
                Col(self, 'segments', model_col=models.Form.segments),
                LinkToMapCol(self, 'm', get_object=lambda i: i.valueset.language),
            ]

        if self.language:
            return [
                LinkCol(self,
                        'parameter',
                        sTitle=self.req.translate('Parameter'),
                        model_col=common.Parameter.name,
                        get_object=lambda i: i.valueset.parameter),
                Col(self, 'name', sTitle='Orthography'),
                Col(self, 'description', sTitle='IPA'),
                Col(self, 'segments', model_col=models.Form.segments),
            ]

        return [
            Col(self, 'name', sTitle='Orthography'),
            Col(self, 'description', sTitle='IPA'),
            Col(self, 'segments', model_col=models.Form.segments),
        ]
Beispiel #8
0
 def col_defs(self):
     return [
         LinkCol(self, 'Name', model_col=sailsLanguage.name),
         LanguageIdCol(self, 'ISO-639-3', sClass='left', model_col=sailsLanguage.id),
         FamilyCol(self, 'Family', get_object=lambda i: i.family),
         Col(self, 'Features', model_col=sailsLanguage.representation),
         LinkToMapCol(self, 'm'),
     ]
Beispiel #9
0
    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),
        ]
Beispiel #10
0
 def col_defs(self):
     return [
         LinkCol(self, 'id', model_col=Contribution.id),
         AmsdLongTextFieldCol(self, 'title', model_col=MessageStick.title),
         AmsdThumbnailCol(self, 'image', sTitle='Image'),
         AmsdFtsCol(self, 'fts', model_col=MessageStick.fts),
         DetailsRowLinkCol(self, 'more'),
         LinkToMapCol(self, 'm'),
     ]
Beispiel #11
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')]
Beispiel #12
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'),
     ]
Beispiel #13
0
 def col_defs(self):
     return [
         LinkToMapCol(self, 'm'),
         LinkCol(self, 'name'),
         SubfamilyCol(self, 'subfamily', model_col=Doculect.subfamily),
         GlottoCodeCol(self, 'glotto_code', model_col=Doculect.glotto_code),
         IsoCodeCol(self, 'iso_code', model_col=Doculect.iso_code),
         Col(self, 'latitude'),
         Col(self, 'longitude')]
Beispiel #14
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'),
     ]
Beispiel #15
0
 def col_defs(self):
     if self.parameter:
         return [
             LinkCol(self, 'language', model_col=common.Language.name, get_object=lambda v: v.valueset.language),
             ValueCol(self, 'word', model_col=Word.name, get_object=lambda v: v.word),
             Col(self, 'description', model_col=Word.description, get_object=lambda v: v.word),
             LinkToMapCol(self, 'm', get_object=lambda v: v.valueset.language),
         ]
     return [
         ValueCol(self, 'word', model_col=Word.name, get_object=lambda v: v.word),
         Col(self, 'description', model_col=Word.description, get_object=lambda v: v.word),
     ]
Beispiel #16
0
 def col_defs(self):
     return [
         LinkCol(self, 'name'),
         FamilyCol(self, 'Family', models.Variety),
         Col(self,
             'latitude',
             sDescription='<small>The geographic latitude</small>'),
         Col(self,
             'longitude',
             sDescription='<small>The geographic longitude</small>'),
         LinkToMapCol(self, 'm'),
     ]
 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')]
Beispiel #18
0
 def col_defs(self):
     return [
         LinkCol(self, 'name'),
         LinkToMapCol(self, 'm', sTitle="Show on map"),
         Col(self,
             'latitude',
             sDescription='<small>The geographic latitude</small>',
             bSearchable=False),
         Col(self,
             'longitude',
             sDescription='<small>The geographic longitude</small>',
             bSearchable=False),
     ]
Beispiel #19
0
 def col_defs(self):
     lang = self.Recipient if self.type == 'donor' else self.Donor
     ltitle = 'Recipient language' if self.type == 'donor' else 'Donor languoid'
     ldesc = {
         'donor':
         "These are the names of languages and families from which the "
         "recipient language borrowed words directly or indirectly.",
         'recipient':
         "These are the names of recipient languages that borrowed words "
         "directly or indirectly from this languoid."
     }[self.type]
     res = []
     if self.language:
         w1desc = {
             'donor':
             "%s words contributed to other languages." %
             self.language.name,
             'recipient':
             "%s words borrowed from other languages." % self.language.name,
         }[self.type]
         w2desc = {
             'donor': "Words borrowed from %s." % self.language.name,
             'recipient': "Words contributed to %s." % self.language.name,
         }[self.type]
         res.extend([
             RelWordsCol(self,
                         'self',
                         sTitle='Borrowed words'
                         if self.type != 'donor' else 'Source words',
                         sDescription=w1desc,
                         model_col=self.SourceWord.name
                         if self.type == 'donor' else self.TargetWord.name),
             RelationCol(self, 'relation'),
             LinkCol(self,
                     'language',
                     sTitle=ltitle,
                     sDescription=ldesc,
                     get_obj=lambda i: i.language,
                     model_col=lang.name),
             LinkCol(self,
                     'other',
                     model_col=common.Unit.name,
                     sTitle='Borrowed word'
                     if self.type == 'donor' else 'Source word',
                     sDescription=w2desc),
             LinkToMapCol(self,
                          'm',
                          get_obj=lambda i: i.language,
                          map_id=self.type + '-map'),
         ])
     return res
Beispiel #20
0
 def col_defs(self):
     return [
         NumberCol(self, 'number', input_size='mini', sClass='right'),
         LinkCol(self, 'name'),
         FamilyCol(self, 'Family', models.Variety),
         Col(self, 'family_in_source', model_col=models.Variety.family_in_source),
         Col(self,
             'latitude',
             sDescription='<small>The geographic latitude</small>'),
         Col(self,
             'longitude',
             sDescription='<small>The geographic longitude</small>'),
         LinkToMapCol(self, 'm'),
     ]
Beispiel #21
0
 def col_defs(self):
     return [
         LinkCol(self, 'name'),
         GlottocodeCol(self, 'id', sTitle='Glottocode'),
         LinkToMapCol(self, 'm'),
         Col(self,
             'latitude',
             sDescription='<small>The geographic latitude</small>'),
         Col(self,
             'longitude',
             sDescription='<small>The geographic longitude</small>'),
         MacroareaCol(self, 'macroarea', Variety),
         FamilyCol(self, 'family', Variety),
     ]
Beispiel #22
0
 def col_defs(self):
     return [
         LanguageIdCol(self, 'id'),
         LinkCol(self, 'name'),
         LinkToMapCol(self, 'm'),
         Col(self,
             'latitude',
             sDescription='<small>The geographic latitude</small>'),
         Col(self,
             'longitude',
             sDescription='<small>The geographic longitude</small>'),
         MacroareaCol(self, 'macroarea', LexibankLanguage),
         FamilyLinkCol(self, 'family', LexibankLanguage),
     ]
Beispiel #23
0
 def col_defs(self):
     return [
         LinkCol(self, 'name'),
         LinkToMapCol(self, 'm'),
         NumeralGlottocodeCol(self, 'Glottocode'),
         NumeralISOCol(self, 'ISO', sTitle='ISO 639-3'),
         Col(self,
             'latitude',
             sDescription='<small>The geographic latitude</small>'),
         Col(self,
             'longitude',
             sDescription='<small>The geographic longitude</small>'),
         FamilyCol(self, "Family", Variety),
         DetailsRowLinkCol(self, 'more'),
     ]
Beispiel #24
0
 def col_defs(self):
     return [
         LanguageIdCol(self, 'id'),
         LinkCol(self, 'name'),
         LinkToMapCol(self, 'm'),
         Col(self,
             'latitude',
             sDescription='<small>The geographic latitude</small>'),
         Col(self,
             'longitude',
             sDescription='<small>The geographic longitude</small>'),
         MacroareaCol(self, 'macroarea', GrambankLanguage),
         FamilyLinkCol(self, 'family', GrambankLanguage),
         Col(self, 'Features', model_col=GrambankLanguage.representation),
     ]
Beispiel #25
0
 def col_defs(self):
     return [
         LanguageIdCol(self, 'id'),
         LinkCol(self, 'name'),
         LinkToMapCol(self, 'm'),
         Col(self,
             'latitude',
             sDescription='<small>The geographic latitude</small>'),
         Col(self,
             'longitude',
             sDescription='<small>The geographic longitude</small>'),
         Col(self, 'region', model_col=LexiRumahLanguage.region),
         FamilyLinkCol(self, 'family', LexiRumahLanguage),
         GlottologLinkCol(self, 'Glottolog'),
         EthnologueLinkCol(self, 'Ethnologue'),
     ]
Beispiel #26
0
 def col_defs(self):
     return [
         LinkCol(self, 'name', sTitle=self.req._('Name')),
         Col(self,
             'Island',
             sTitle=self.req._('Island'),
             model_col=models.Variety.island,
             choices=get_distinct_values(models.Variety.island)),
         Col(self,
             'latitude',
             sDescription='<small>The geographic latitude</small>'),
         Col(self,
             'longitude',
             sDescription='<small>The geographic longitude</small>'),
         LinkToMapCol(self, 'm'),
     ]
Beispiel #27
0
    def col_defs(self):
        name_col = ValueNameCol(self, 'value')
        if self.parameter and self.parameter.domain:
            name_col.choices = [de.name for de in self.parameter.domain]

        res = [DetailsRowLinkCol(self, 'd')]

        if self.parameter:
            return res + [
                LinkCol(self,
                        'language',
                        model_col=Language.name,
                        get_object=lambda i: i.valueset.language),
                name_col,
                RefsCol(self, 'source'),
                LinkToMapCol(
                    self, 'm', get_object=lambda i: i.valueset.language),
            ]

        if self.language:
            return res + [
                name_col,
                LinkCol(self,
                        'parameter',
                        sTitle=self.req.translate('Parameter'),
                        model_col=Parameter.name,
                        get_object=lambda i: i.valueset.parameter),
                # RefsCol(self, 'source'),
                Col(self,
                    'source orthography',
                    model_col=Word.sourceorthography),
                Col(self, 'KBA orthography', model_col=Word.kbaorthography),
                Col(self, 'Word class', model_col=Word.wordclass),
                Col(self, 'Grammatical notes',
                    model_col=Word.grammaticalnotes),
                Col(self,
                    'Idiolectal variant',
                    model_col=Word.idiolectalvariant),
                Col(self, 'comment', model_col=Word.comment),
                # Col(self, 'original translation', model_col=Word.originaltranslation)
            ]

        return res + [
            name_col,
            ValueSetCol(self, 'valueset', bSearchable=False, bSortable=False),
        ]
Beispiel #28
0
 def col_defs(self):
     return [
         LinkToMapCol(self, 'm'),
         LinkCol(self, 'name'),
         ExtLinkCol(self,
                    'glottocode',
                    'glottolog',
                    model_col=Doculect.code_glottolog),
         IsoCol(self, 'iso', model_col=Doculect.code_iso),
         ExtLinkCol(self,
                    'wals',
                    'wals',
                    sTitle='WALS',
                    input_size='mini',
                    model_col=Doculect.code_wals),
         Col(self, 'latitude', input_size='mini'),
         Col(self, 'longitude', input_size='mini'),
         YesNoCol(self,
                  'long_extinct',
                  sTitle='Ancient',
                  input_size='mini',
                  model_col=Doculect.long_extinct),
         YesNoCol(self,
                  'recently_extinct',
                  input_size='mini',
                  model_col=Doculect.recently_extinct),
         Col(self,
             'year_of_extinction',
             input_size='mini',
             model_col=Doculect.year_of_extinction),
         Col(self,
             'classification_wals',
             sTitle='Classification WALS',
             format=lambda i: normalize_classification(
                 i.classification_wals, 'wals'),
             model_col=Doculect.classification_wals),
         Col(self,
             'classification_glottolog',
             sTitle='Classification Glottolog',
             format=lambda i: normalize_classification(
                 i.classification_glottolog),
             model_col=Doculect.classification_glottolog),
     ]
Beispiel #29
0
 def col_defs(self):
     return [
         LinkCol(self, 'name'),
         Col(self,
             'glottocode_',
             sDescription='Glottolog code',
             model_col=models.Languoid.glottocode_),
         Col(self,
             'latitude',
             sDescription='<small>The geographic latitude</small>',
             model_col=models.Languoid.latitude,
             bSearchable=False),
         Col(self,
             'longitude',
             sDescription='<small>The geographic longitude</small>',
             model_col=models.Languoid.longitude,
             bSearchable=False),
         LinkToMapCol(self, 'm'),
     ]
 def col_defs(self):
     return [
         LinkToMapCol(self, 'm'),
         LinkCol(self, 'name'),
         SubGroupCol(self,
                     'subfamily',
                     choices=get_distinct_values(models.Doculect.subfamily),
                     model_col=models.Doculect.subfamily),
         Col(self, 'glottocode', model_col=models.Doculect.glotto_code),
         Col(self,
             'isocode',
             sTitle='ISO Code',
             model_col=models.Doculect.iso_code),
         Col(self,
             'latitude',
             sDescription='<small>The geographic latitude</small>'),
         Col(self,
             'longitude',
             sDescription='<small>The geographic longitude</small>'),
     ]