Esempio n. 1
0
def example_two():
    user = User(name='Zé', number=13, birth_date=datetime.datetime.now(),
            password='******')
    form = make_form(user, column=['name', 'password'],
            widgets={'name': deform.widget.TextAreaWidget()})
    print form.render()
    form = make_form(user)
    print form.render()
Esempio n. 2
0
    def test_make_form(self):
        import deform
        import sqlalchemy2deform

        M = self._makeModel()
        S = self._makeSchema()

        myform = deform.Form(S(), buttons=('submit',))
        form = sqlalchemy2deform.make_form(M)

        self.assertEqual(form.render(), myform.render())
Esempio n. 3
0
    def test_make_form_using_instance(self):
        import deform
        import sqlalchemy2deform

        M = self._makeModel()
        S = self._makeSchema()

        appstruct = {'unicode_column': u'unicode text (áç¢)',
                'float_column': 5.3}
        m = M(**appstruct)

        myform = deform.Form(S(), buttons=('submit',))
        form = sqlalchemy2deform.make_form(m)

        self.assertEqual(form.render(), myform.render(appstruct))
Esempio n. 4
0
def example_one():
    form = make_form(User)
    print form.render({'name': 'Luiz Armesto', 'number': 15,
            'birth_date': datetime.datetime.now()})
Esempio n. 5
0
def example():
    form = make_form(User)
    form.render({"name": "Luiz Armesto", "number": 15, "birth_date": datetime.datetime.now()})