Esempio n. 1
0
 def text(self, name, value=None, id=None, **attrs):
     kw = {"maxlength": 200, "size": const.TEXT_SIZE}
     kw.update(attrs)
     if kw["size"] is not None:
         kw["size"] = min((kw["maxlength"] + 1, kw["size"]))
     return FormRenderer.text(self, name, value, self._fix_id(id or name),
                              **kw)
Esempio n. 2
0
    def test_text(self):
        from pyramid_simpleform import Form
        from pyramid_simpleform.renderers import FormRenderer

        request = testing.DummyRequest()
        form = Form(request, SimpleFESchema, defaults={"name": "Fred"})
        renderer = FormRenderer(form)

        self.assert_(renderer.text("name") == '<input id="name" name="name" type="text" value="Fred" />')
Esempio n. 3
0
    def test_text(self):
        from pyramid_simpleform import Form
        from pyramid_simpleform.renderers import FormRenderer

        request = testing.DummyRequest()
        form = Form(request, SimpleFESchema, defaults={"name": "Fred"})
        renderer = FormRenderer(form)

        self.assert_(renderer.text("name") == \
                '<input id="name" name="name" type="text" value="Fred" />')
 def text(self, name, value=None, id=None, **attrs):
     kw = {'maxlength': 200, 'class_': 'text'}
     kw.update(attrs)
     return FormRenderer.text(self, name, value, id, **kw)
Esempio n. 5
0
 def text(self, name, value=None, id=None, **attrs):
     kw = {'maxlength': 200, 'class_': 'text'}
     kw.update(attrs)
     return FormRenderer.text(self, name, value, id, **kw)
Esempio n. 6
0
	def text(self, name, value=None, id=None, **attrs):
		kw = {'maxlength': 200, 'size': const.TEXT_SIZE}
		kw.update(attrs)
		kw['size'] = min((kw['maxlength']+1, kw['size']))
		return FormRenderer.text(self, name, value, self._fix_id(id or name), **kw)