Re: [web2py] Re: Adding fields to the default register form;

2011-01-28 Thread Anthony
On Thursday, January 27, 2011 12:53:34 PM UTC-5, rochacbruno wrote: *Manipulation of the SQLFORM object* {{=form.elements()[0].insert(0,LABEL('test:',INPUT(_type='text')))}} or in a more comprehensive way {{=form.elements('form tr td')[0].insert(0,INPUT())}} Altering forms via

Re: [web2py] Re: Adding fields to the default register form;

2011-01-28 Thread Bruno Rocha
2011/1/28 Anthony abasta...@gmail.com On Thursday, January 27, 2011 12:53:34 PM UTC-5, rochacbruno wrote: *Manipulation of the SQLFORM object* {{=form.elements()[0].insert(0,LABEL('test:',INPUT(_type='text')))}} or in a more comprehensive way {{=form.elements('form tr

Re: [web2py] Re: Adding fields to the default register form;

2011-01-28 Thread Anthony
On Friday, January 28, 2011 9:15:20 PM UTC-5, rochacbruno wrote: 2011/1/28 Anthony abas...@gmail.com Altering forms via server-side DOM manipulations should be documented in the book. It seems to come up a lot, but I don't think it's all that obvious or explicit in the book. The Views

Re: [web2py] Re: Adding fields to the default register form;

2011-01-27 Thread David J.
The fact that auth is so tightly coupled with the view is very frustrating; It would be better if auth return an object that was wrappable; in FORM(); rather than the rendered form This way you can do things like addfield() to the form before it is rendered or just render it as it is; I

Re: [web2py] Re: Adding fields to the default register form;

2011-01-27 Thread Bruno Rocha
2011/1/27 David J. da...@styleflare.com I asked before what is the easiest way to add a non-database field to the registration form Right now I dont see an easy way to do this; You can interact with the HTML for the FORM object. form = auth() form.elements[0].append(SOME_OTHER_ELEMENT)

Re: [web2py] Re: Adding fields to the default register form;

2011-01-27 Thread Anthony
Sorry, my misunderstanding. Thanks for clarifying, Bruno. Anthony On Thursday, January 27, 2011 12:53:34 PM UTC-5, rochacbruno wrote: 2011/1/27 David J. da...@styleflare.com I asked before what is the easiest way to add a non-database field to the registration form Right now I dont

[web2py] Re: Adding fields to the default register form;

2011-01-26 Thread Massimo Di Pierro
should be auth.settings.formstyle='divs' form=auth() you cannot set the formstyle after the form is created. On Jan 25, 10:33 am, Anthony abasta...@gmail.com wrote: On Tuesday, January 25, 2011 10:41:02 AM UTC-5, David J wrote: I still cant seem to change the default view from 'table3cols'

Re: [web2py] Re: Adding fields to the default register form;

2011-01-26 Thread Vinicius Assef
Just a doubt: why not? Is the layout generated in form create time or in show time? In my opinion Anthony's way to understand is more intuitive than yours: 1) First I create the form. 2) After that I set its properties. Am I wrong? -- Vinicius Assef. On Wed, Jan 26, 2011 at 12:42 PM,

Re: [web2py] Re: Adding fields to the default register form;

2011-01-26 Thread Anthony
On Wednesday, January 26, 2011 10:36:06 AM UTC-5, viniciusban wrote: Just a doubt: why not? Is the layout generated in form create time or in show time? In my opinion Anthony's way to understand is more intuitive than yours: 1) First I create the form. 2) After that I set its

Re: [web2py] Re: Adding fields to the default register form;

2011-01-26 Thread Vinicius Assef
I see, but it isn't intuitive, right? Why must I adjust properties of something (the form itself) doesn't exist yet? -- Vinicius Assef. On Wed, Jan 26, 2011 at 3:03 PM, Anthony abasta...@gmail.com wrote: On Wednesday, January 26, 2011 10:36:06 AM UTC-5, viniciusban wrote: Just a doubt: why

Re: [web2py] Re: Adding fields to the default register form;

2011-01-26 Thread Bruno Rocha
In my view, 'formstyle' is a parameter of SQLFORM() helper, I dont think it has anything wrong. In the case of auth, we are not adjusting properties of the form, we are just storing the properties somewhere, that place is auth.settings dictionary. This the same way we do with plugins when using

Re: [web2py] Re: Adding fields to the default register form;

2011-01-26 Thread Bruno Rocha
Thinking a bit more, taking the Vinicius comment and some examples of another O.O frameworks. I was wondering about... #1 form = auth() print form # return the HTML with tables #2 auth.settings.formstyle = 'divs' form = auth() print form # return the HTML with divs #3 form = auth() print