Beispiel #1
0
 def render(self, element=None):
     Widget.render(self)
     f = Kitchen(self.get_form().get_widget_template_dirs(),
                 self.get_form().get_widget_template_extensions())
     f = f.get("select")
     if f:
         t = Template(filename=f)
         return t.render(**self.export())
     return u''
Beispiel #2
0
 def render(self, markup=None):
     Widget.render(self)
     f = Kitchen(self.get_form().get_widget_template_dirs(),
                 self.get_form().get_widget_template_extensions())
     f = f.get('password')
     if f:
         t = Template(filename=f)
         return t.render(**self.export())
     return u''
Beispiel #3
0
 def export(self):
     desc = Widget.export(self)
     desc["options"] = self.options
     return desc
Beispiel #4
0
 def __init__(self, *argc, **argv):
     self.options = argv.get("options", {})
     if 'options' in argv:
         del argv['options']
     Widget.__init__(self, *argc, **argv)
Beispiel #5
0
 def export(self):
     desc = Widget.export(self)
     desc["size"] = self.size
     desc["readonly"] = self.readonly
     return desc
Beispiel #6
0
 def __init__(self, *argc, **argv):
     for key in ('size', 'readonly'):
         setattr(self, key, argv.get(key, getattr(self, key)))
         if key in argv:
             del argv[key]
     Widget.__init__(self, *argc, **argv)
Beispiel #7
0
 def export(self):
     desc = Widget.export(self)
     desc['cols'] = self.cols
     desc['rows'] = self.rows
     desc['readonly'] = self.readonly
     return desc
Beispiel #8
0
 def set_form(self, form):
     Widget.set_form(self, form)
     form.attr("enctype", "multipart/form-data")
Beispiel #9
0
 def export(self):
     desc = Widget.export(self)
     desc["path"] = self.path
     return desc
Beispiel #10
0
 def __init__(self, *argc, **argv):
     self.path = argv.get('path', self.path)
     if "path" in argv:
         del argv["path"]
     Widget.__init__(self, *argc, **argv)