Ejemplo n.º 1
0
 def __init__(self, dt, name, language_cls, link=False, **kw):
     self._link = link
     self._col = getattr(language_cls, 'family')
     kw['choices'] = [
         (f.id, f.name) for f in DBSession.query(Family).order_by(Family.name)]
     kw['choices'].insert(0, ('isolate', '--none--'))
     Col.__init__(self, dt, name, **kw)
Ejemplo n.º 2
0
 def __init__(self, dt, name, **kw):
     kw['choices'] = [
         r[0] for r in DBSession.query(ImageData.value).filter(
             ImageData.key == 'permission').order_by(
                 ImageData.value).distinct()
     ]
     Col.__init__(self, dt, name, **kw)
Ejemplo n.º 3
0
 def __init__(self, model, taxon_col, *args, **kw):
     self.taxon_col = taxon_col
     kw['choices'] = [
         (o.id, '%s %s' % (o.id, o.name)) for o in
         DBSession.query(model).filter(model.active == true()).order_by(model.id)]
     kw['model_col'] = getattr(Taxon, self.taxon_col)
     Col.__init__(self, *args, **kw)
Ejemplo n.º 4
0
 def __init__(self, dt, name, languages, **kw):
     assert languages
     self.lang_dict = {l.pk: l for l in languages}
     q = DBSession.query(Category.name).order_by(Category.name)\
         .filter(Category.language_pk.in_(list(self.lang_dict.keys())))
     kw['choices'] = [r[0] for r in q]
     Col.__init__(self, dt, name, **kw)
Ejemplo n.º 5
0
 def __init__(self, model, taxon_col, *args, **kw):
     self.taxon_col = taxon_col
     kw['choices'] = [(o.id, '%s %s' % (o.id, o.name))
                      for o in DBSession.query(model).filter(
                          model.active == true()).order_by(model.id)]
     kw['model_col'] = getattr(Taxon, self.taxon_col)
     Col.__init__(self, *args, **kw)
Ejemplo n.º 6
0
 def __init__(self, dt, name, **kw):
     kw['choices'] = [
         r[0][5:].capitalize() for r in DBSession.query(Value_data.key)
         .filter(Value_data.key.startswith('lang_'))
         .order_by(Value_data.key)
         .distinct()]
     kw['bSortable'] = False
     Col.__init__(self, dt, name, **kw)
Ejemplo n.º 7
0
 def __init__(self, *args, **kw):
     choices = set()
     for row in DBSession.query(Species.order, Species.family, Species.genus):
         for name in row:
             if name:
                 choices.add(name)
     kw['choices'] = sorted(choices)
     Col.__init__(self, *args, **kw)
Ejemplo n.º 8
0
 def __init__(self, dt, name, language_cls, link=False, **kw):
     self._link = link
     self._col = getattr(language_cls, 'family')
     kw['choices'] = [(f.id, f.name)
                      for f in DBSession.query(Family).order_by(Family.name)
                      ]
     kw['choices'].insert(0, ('isolate', '--none--'))
     Col.__init__(self, dt, name, **kw)
Ejemplo n.º 9
0
 def __init__(self, dt, name, **kw):
     self.subtype = kw.pop('subtype', name)
     kw['sDescription'] = {
         'mp4': external_link('https://en.wikipedia.org/wiki/MPEG-4'),
         'quicktime': external_link('https://en.wikipedia.org/wiki/QuickTime'),
         'x-msvideo': external_link('https://en.wikipedia.org/wiki/Audio_Video_Interleave'),
     }[self.subtype]
     kw['sTitle'] = name.upper()
     Col.__init__(self, dt, name, **kw)
Ejemplo n.º 10
0
 def __init__(self, dt, name, **kw):
     kw['choices'] = [
         r[0][5:].capitalize()
         for r in DBSession.query(Value_data.key).filter(
             Value_data.key.startswith('lang_')).order_by(
                 Value_data.key).distinct()
     ]
     kw['bSortable'] = False
     Col.__init__(self, dt, name, **kw)
Ejemplo n.º 11
0
 def __init__(self, *args, **kw):
     choices = set()
     self.rank_cols = [Taxon.kingdom, Taxon.phylum, Taxon.class_, Taxon.family]
     for row in DBSession.query(*self.rank_cols):
         for name in row:
             if name:
                 choices.add(name)
     kw['choices'] = sorted(choices)
     Col.__init__(self, *args, **kw)
Ejemplo n.º 12
0
 def __init__(self, *args, **kw):
     choices = set()
     self.rank_cols = [
         Taxon.kingdom, Taxon.phylum, Taxon.class_, Taxon.family
     ]
     for row in DBSession.query(*self.rank_cols):
         for name in row:
             if name:
                 choices.add(name)
     kw['choices'] = sorted(choices)
     Col.__init__(self, *args, **kw)
Ejemplo n.º 13
0
 def __init__(self, dt, name, **kw):
     kw['choices'] = DBSession.query(Biome.id, Biome.name)\
         .order_by(as_int(Biome.id))
     Col.__init__(self, dt, name, **kw)
Ejemplo n.º 14
0
 def __init__(self, dt, *args, **kw):
     kw['choices'] = [(c.pk, c.name) for c in self._choices(dt)]
     Col.__init__(self, dt, *args, **kw)
Ejemplo n.º 15
0
 def __init__(self, dt, name, lang, alias, **kw):
     self.lang = lang
     self.alias = alias
     kw['sTitle'] = 'Colloquial names in %s' % lang.name
     Col.__init__(self, dt, name, **kw)
Ejemplo n.º 16
0
 def __init__(self, dt, name, roleid, **kw):
     kw['sTitle'] = ROLES[roleid]
     Col.__init__(self, dt, name, **kw)
     self.roleid = roleid
Ejemplo n.º 17
0
 def __init__(self, dt, name, **kw):
     kw['choices'] = [(sd, sd.replace('_', ' ')) for sd in get_distinct_values(Entry.sd)]
     kw['model_col'] = Entry.sd
     Col.__init__(self, dt, name, **kw)
Ejemplo n.º 18
0
 def __init__(self, dt, name, maintype, **kw):
     self.maintype = maintype
     kw['bSearchable'] = False
     kw['bSortable'] = False
     Col.__init__(self, dt, name, **kw)
Ejemplo n.º 19
0
 def __init__(self, dt, name, language_cls, **kw):
     self._col = getattr(language_cls, 'macroarea')
     kw['choices'] = get_distinct_values(self._col)
     self.language_cls = language_cls
     Col.__init__(self, dt, name, **kw)
Ejemplo n.º 20
0
 def __init__(self, dt, name, sds, **kw):
     kw['choices'] = sds
     Col.__init__(self, dt, name, **kw)
Ejemplo n.º 21
0
 def __init__(self, dt, name, **kw):
     kw['sTitle'] = "Function(s)"
     Col.__init__(self, dt, name, **kw)
Ejemplo n.º 22
0
 def __init__(self, dt, name, **kw):
     kw['sTitle'] = "Cognate set(s)"
     Col.__init__(self, dt, name, **kw)
Ejemplo n.º 23
0
 def __init__(self, *args, **kw):
     kw['choices'] = [
         (f.pk, f.name) for f in DBSession.query(Family).order_by(Family.name)]
     kw['model_col'] = Family.name
     Col.__init__(self, *args, **kw)
Ejemplo n.º 24
0
 def __init__(self, dt, name, **kw):
     kw['choices'] = DBSession.query(Biome.id, Biome.name)\
         .order_by(as_int(Biome.id))
     Col.__init__(self, dt, name, **kw)
Ejemplo n.º 25
0
 def __init__(self, dt, name, **kw):
     kw['choices'] = [
         r[0] for r in DBSession.query(Lineage.name).order_by(Lineage.name)
     ]
     kw['model_col'] = Lineage.name
     Col.__init__(self, dt, name, **kw)
Ejemplo n.º 26
0
 def __init__(self, dt, *args, **kw):
     kw['choices'] = [(c.pk, c.name) for c in self._choices(dt)]
     Col.__init__(self, dt, *args, **kw)
Ejemplo n.º 27
0
 def __init__(self, dt, name, **kw):
     kw['choices'] = get_distinct_values(Languoid.lineage)
     kw['model_col'] = Languoid.lineage
     Col.__init__(self, dt, name, **kw)
Ejemplo n.º 28
0
 def __init__(self, dt, name, index, spec, **kw):
     kw['sTitle'] = spec[0]
     Col.__init__(self, dt, name, **kw)
     self.index = index
     self.choices = spec[1]
Ejemplo n.º 29
0
 def __init__(self, *args, **kw):
     kw['choices'] = [
         er.name for er in
         DBSession.query(Ecoregion).join(SpeciesEcoregion).order_by(Ecoregion.id)]
     kw['model_col'] = Species.ecoregions_str
     Col.__init__(self, *args, **kw)
Ejemplo n.º 30
0
 def __init__(self, dt, name, alias, **kw):
     self.alias = alias
     kw['sTitle'] = name.capitalize()
     Col.__init__(self, dt, name, **kw)
Ejemplo n.º 31
0
 def __init__(self, dt, name, sds, **kw):
     kw['choices'] = sds
     Col.__init__(self, dt, name, **kw)
Ejemplo n.º 32
0
 def __init__(self, dt, name, alias, **kw):
     self.alias = alias
     kw['sTitle'] = name.capitalize()
     Col.__init__(self, dt, name, **kw)
Ejemplo n.º 33
0
 def __init__(self, dt, name, **kw):
     kw['sTitle'] = 'Alternative reconstruction' if dt.language and dt.language.proto \
         else 'Phonetic Siouan'
     Col.__init__(self, dt, name, **kw)
Ejemplo n.º 34
0
 def __init__(self, *args, **kw):
     kw['choices'] = [
         (f.pk, f.name) for f in DBSession.query(Family).order_by(Family.name)]
     kw['model_col'] = Family.name
     Col.__init__(self, *args, **kw)
Ejemplo n.º 35
0
 def __init__(self, dt, name, **kw):
     kw['choices'] = ['yes']
     kw['input-size'] = 'mini'
     kw['model_col'] = Sentence_files.id
     Col.__init__(self, dt, name, **kw)
Ejemplo n.º 36
0
 def __init__(self, dt, name, **kw):
     sq = DBSession.query(models.Village.languoid_pk).distinct().subquery()
     kw['choices'] = [
         (l.id, l.name) for l in
         DBSession.query(common.Language).filter(common.Language.pk.in_(sq))]
     Col.__init__(self, dt, name, **kw)
Ejemplo n.º 37
0
 def __init__(self, dt, name, cls, attribute = 'combinatory_status', **kw):
     self._col = getattr(cls, attribute)
     self.attribute = attribute
     kw['choices'] = get_distinct_values(self._col)
     Col.__init__(self, dt, name, **kw)
Ejemplo n.º 38
0
 def __init__(self, dt, name, **kw):
     kw['choices'] = ['yes']
     kw['input-size'] = 'mini'
     kw['model_col'] = Sentence_files.id
     Col.__init__(self, dt, name, **kw)
Ejemplo n.º 39
0
 def __init__(self, dt, name, **kw):
     kw['choices'] = [
         r[0] for r in DBSession.query(Lineage.name).order_by(Lineage.name)]
     kw['model_col'] = Lineage.name
     Col.__init__(self, dt, name, **kw)
Ejemplo n.º 40
0
 def __init__(self, dt, name, link_type, **kw):
     self.link_type = link_type
     Col.__init__(self, dt, name, **kw)
Ejemplo n.º 41
0
 def __init__(self, dt, name, **kw):
     kw['choices'] = [
         r[0] for r in DBSession.query(ImageData.value)
         .filter(ImageData.key == 'permission')
         .order_by(ImageData.value).distinct()]
     Col.__init__(self, dt, name, **kw)
Ejemplo n.º 42
0
 def __init__(self, dt, name, lang, alias, **kw):
     self.lang = lang
     self.alias = alias
     kw['sTitle'] = 'Colloquial names in %s' % lang.name
     Col.__init__(self, dt, name, **kw)
Ejemplo n.º 43
0
 def __init__(self, dt, name, **kw):
     kw['sDescription'] = 'If "yes" the word is a dialectal variant.'
     kw['sFilter'] = '2'
     kw['model_col'] = Entry.variant
     kw['choices'] = [('1', 'yes'), ('2', 'no')]
     Col.__init__(self, dt, name, **kw)
Ejemplo n.º 44
0
 def __init__(self, dt, name, language_cls, **kw):
     self._col = getattr(language_cls, 'macroarea')
     kw['choices'] = get_distinct_values(self._col)
     self.language_cls = language_cls
     Col.__init__(self, dt, name, **kw)
Ejemplo n.º 45
0
 def __init__(self, dt, name, maintype, **kw):
     self.maintype = maintype
     kw['bSearchable'] = False
     kw['bSortable'] = False
     Col.__init__(self, dt, name, **kw)
Ejemplo n.º 46
0
 def __init__(self, dt, name, link_type, **kw):
     self.link_type = link_type
     Col.__init__(self, dt, name, **kw)