Adding another field to the auth_user registration form

24 views
Skip to first unread message

mostwanted

unread,
Jun 28, 2019, 4:31:40 AM6/28/19
to web...@googlegroups.com
How can I add another field of my desire to the web2py auth_user registration form?
In my registration form in addition to all the fields i want my clients to also register their telephone and cell phone numbers.
I have tried to add this to the db.py file but they are not appearing!
auth.settings.extra_fields['auth_user'] = [Field('Telephone'), Field('Cell_Number')]
auth
.define_tables()
 
Am i doing something wrong??

Regards;

Mostwanted

mostwanted

unread,
Jun 28, 2019, 5:24:56 AM6/28/19
to web2py-users
I have figured it out, db.py already has this defined in line 137 & 138
auth.settings.extra_fields['auth_user'] = []
auth
.define_tables(username=False, signature=False)

All i needed to do was add my fields [Field('Telephone'), Field('Cell_Number')] in the [ ] empty square paranthesis and voila....

Regards;

Mostwanted
Reply all
Reply to author
Forward
0 new messages