You want that to appear when you login??

It not going to work like that... You can check that what you have done so
far works by using appadmin db tool you should see your radio button field
in the form to add or update value of database...

You need to do other thing if you want to modify login form.

Richard

On Fri, Dec 4, 2015 at 4:45 PM, Jonathan R <[email protected]> wrote:

> Hi everyone,
> I'm trying to add a radio button on my login form to let the user decide
> which authentication method he wants to use.
>
> I added a field in the auth_user table and i try to display the
> corresponding radio button in my login page as follow:
>
> in bd.py
>
> [......]
>
> auth.settings.extra_fields['auth_user']=[Field]('method',
> requires=IS_IN_SET(['choice 1','choice
> 2']),widget=SQLFORM.widgets.radio.widget),]
>
> auth.define_tables(username=True)
>
>
> [...]
>
> in user.html
>
> [...]
>
> {{form=auth.login()}}
>
> [...]
>
> {{=form.custom.begin}}
> Method to Use:
> {{=form.custom.widget.method}}
> </br>
> Username:
> {{=form.custom.widget.username}}
> </br>
> Password:
> {{=form.custom.widget.password}}
> {{=form.custom.submit}}
> {{=form.custom.end}}
>
>
> [...]
>
> This displays correctly the Username and password fields as text and
> password field but instead of the radio Button the app return None.
>
> I checked the db table and the field is created.
>
> What am I doing wrong ?
>
> Thank you for your help.
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to