1

I am trying to add a slider to my deform form and I saw that it is possible to create our own widget using plain HTML. I tried the following with no luck. Any hint? Is there some other library that can be used to augment the number of widgets?

class MyInputWidget(Widget):
    def serialize(self, field, cstruct=None, readonly=False):
        if cstruct is null:
            cstruct = u''
        quoted = cgi.escape(cstruct, quote='"')
        return u'<input id="slider1" type="range" min="0" max="1" step="0.1" value="%s">' % quoted


test = colander.SchemaNode(MyInputWidget())
tupui
  • 5,738
  • 3
  • 31
  • 52
  • Open source software is only as limited as those who contribute to it. That said, there is an open PR that lacks tests and documentation that you can pull from. https://github.com/Pylons/deform/pull/345 – Steve Piercy Jul 24 '17 at 00:12
  • @StevePiercy Thanks for the PR. I am just surprised to find such slim doc/tutos etc. for such a large community. – tupui Jul 24 '17 at 08:43
  • The GitHub stats indicate that deform itself is not a large community https://github.com/pylons/deform Or did you mean Pyramid or the Pylons Project organization? – Steve Piercy Jul 24 '17 at 18:22
  • @StevePiercy I ment Pyramid in general. But hey it wasn't an attack, I am sorry if you felt like it was. Plus I am really new to it and find it really nice :) – tupui Jul 24 '17 at 19:21
  • No worries, it's a common mis-assumption (is that a word?). Pyramid itself does not include a form library. Pyramid Developers may choose any form library (or none or write their own), and Deform is just one of them. And you don't have to use Pyramid to use Deform. The communities intersect, and there are members of one but not the other. In any case, both of these open source software projects are 100% volunteer, and we apologize up front for slim docs/tuts. Both welcome new users, especially those who contribute to docs and tutorials to fatten them up. – Steve Piercy Jul 24 '17 at 23:48

0 Answers0