Пример #1
0
 def __init__(self, req, name, eid, collection=None, url=None, selected=None):
     MultiSelect.__init__(self, req, name, eid, url='x')
     self.data = []
     for app, rm in req.registry.settings.get('clld.parameters', {}).items():
         for param in rm['resources']:
             self.data.append({
                 'id': '%s-%s' % (app, param['id']),
                 'text': '%s %s: %s' % (app, param['id'], param['name'])})
     self._datadict = dict((d['id'], d) for d in self.data)
Пример #2
0
 def __init__(self, req, name, eid, collection=None, url=None, selected=None):
     MultiSelect.__init__(self, req, name, eid, url='x')
     self.data = []
     for app, rm in req.registry.settings.get('clld.parameters', {}).items():
         for param in rm['resources']:
             self.data.append({
                 'id': '%s-%s' % (app, param['id']),
                 'text': '%s %s: %s' % (app, param['id'], param['name'])})
     self._datadict = dict((d['id'], d) for d in self.data)
Пример #3
0
 def __init__(self,
              ctx,
              req,
              name='cladefilter',
              eid='ms-cladefilter',
              **kw):
     if ctx.cladefilter and len(ctx.cladefilter[0]):
         kw['selected'] = ctx.cladefilter
     else:
         kw['selected'] = None
     MultiSelect.__init__(self, req, name, eid, **kw)
Пример #4
0
 def __init__(self, ctx, req, name, eid, **kw):
     if getattr(ctx, name) and len(getattr(ctx, name)[0]):
         kw['selected'] = getattr(ctx, name)
     else:
         kw['selected'] = None
     MultiSelect.__init__(self, req, name, eid, **kw)
Пример #5
0
 def __init__(self, ctx, req, name='languages', eid='ms-languages', **kw):
     kw['selected'] = ctx.languages
     MultiSelect.__init__(self, req, name, eid, **kw)
Пример #6
0
 def __init__(self, ctx, req, name='languages', eid='ms-languages', **kw):
     kw['selected'] = ctx.languages
     MultiSelect.__init__(self, req, name, eid, **kw)