On Jun 26, 6:16 pm, Giuseppe Luca Scrofani <glsdes...@gmail.com> wrote: > Hi, something like this is possible? Automatic generation of forms by > db is just too lazy and beautiful to make me manually construct them > just for some space in between fields... > > db.define_table('example', > Field('one'), > Field('two'), > Field('three'), > (insert a br here), > Field('for'), > Field('five'), > Field('six'), > (inser another br here), > Field('seven')) > > This or something like css trick...
Look at http://www.web2py.com/book/default/section/7/2 for an example. If you use something like: form = SQLFORM( db.example, formstyle='divs') this generates a form using css classes, and you can modify the css to get the effects you want. You can see what this looks like with the shell: python web2py.py -S welcome >>> db = DAL('sqlite:memory:') >>> db.define_table( 'example', Field('one'), Field('two')) >>> form = SQLFORM(db.example, formstyle = 'divs' ) >>> print form Regards, - Yarko > > gls