Example #1
0
    def get_legends(self):
        items = []

        for biome in DBSession.query(Biome)\
                .filter(Biome.description != 'ffffff')\
                .order_by(as_int(Biome.id)):
            items.append(
                HTML.label(
                    HTML.span(
                        literal('      '),
                        style='background-color: #%s;' % biome.description,
                        class_='biome-color'),
                    literal(biome.name),
                    style='margin-left: 1em; margin-right: 1em;'))
        yield Legend(self, 'categories', items)
Example #2
0
    def get_legends(self):
        items = []

        for biome in DBSession.query(Biome)\
                .filter(Biome.description != 'ffffff')\
                .order_by(as_int(Biome.id)):
            items.append(
                HTML.label(
                    HTML.span(
                        literal('      '),
                        style='background-color: #%s;' % biome.description,
                        class_='biome-color'),
                    literal(biome.name),
                    style='margin-left: 1em; margin-right: 1em;'))
        yield Legend(self, 'categories', items)
Example #3
0
 def get_layers(self):
     for canton, dialects in itertools.groupby(
             DBSession.query(models.Variety).order_by(
                 models.Variety.canton, as_int(common.Language.id)),
             lambda l: l.canton):
         dialects = list(dialects)
         json = DialectsGeoJson(None).render(dialects, self.req, dump=False)
         yield Layer(slug(canton),
                     canton,
                     data=json,
                     marker=HTML.span(
                         helpers.map_marker_img(self.req,
                                                dialects[0],
                                                marker=self.map_marker),
                         literal(' '),
                         dialects[0].canton_img(self.req),
                         literal(' ')))
Example #4
0
 def order(self):
     return as_int(self.model_col)
Example #5
0
 def search(self, qs):
     return filter_number(as_int(self.model_col), qs, type_=int)
Example #6
0
 def order(self):
     return as_int(Biome.id)
Example #7
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)
Example #8
0
File: base.py Project: clld/clld
 def order(self):
     return as_int(self.model_col)
Example #9
0
File: base.py Project: clld/clld
 def search(self, qs):
     return filter_number(as_int(self.model_col), qs, type_=int)
Example #10
0
 def order(self):
     return as_int(common.Parameter.id)
Example #11
0
 def order(self):
     return as_int(common.Language.id)
Example #12
0
 def order(self):
     return as_int(Biome.id)
Example #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)