Hello
I have the following question
In user register I show only some fields for user, but in user profile I
would like to add more fields.
This fields come from tables referenced on auth_user table
my db.py code so far is
db.define_table('auth_user',
Field('username', type='string',
label=T('Username')),
Field('first_name', type='string',
label=T('First Name')),
Field('last_name', type='string',
label=T('Last Name')),
Field('email', type='string',
label=T('Email')),
Field('password', type='password',
readable=False,
label=T('Password')),
Field('created_on','datetime',default=request.now,
label=T('Created On'),writable=False,readable=False),
Field('modified_on','datetime',default=request.now,
label=T('Modified On'),writable=False,readable=False,
update=request.now),
Field('registration_key',default='',
writable=False,readable=False),
Field('reset_password_key',default='',
writable=False,readable=False),
Field('registration_id',default='',
writable=False,readable=False),
Field('organization', 'reference organization'), #### reference to
table organization
format='%(username)s',
migrate=settings.migrate)
##fileds from table organization
auth.settings.extra_fields['auth_user']= [
Field('o_name','reference organization'),
Field('o_telnumber','reference organization'),
Field('o_street','reference organization'),
Field('o_city','reference organization'),
Field('o_state','reference organization'),
Field('o_country','reference organization'),
Field('o_TaxNumber','reference organization'),
Field('o_note','reference organization'),
]
## table organization
db.define_table('organization',
Field('o_id_o',type='integer' ),
Field('o_usern',type='integer' ),
Field('o_daten',type='date'),
Field('o_useru',type='integer' ),
Field('o_dateu',type='date' ),
Field('o_status',type='integer' ),
Field('o_code',type='string', length = 64 ),
Field('o_name',type='string', length = 256 ),
Field('o_telnumber',type='string', length = 64 ),
Field('o_faxnumber',type='string', length = 64 ),
Field('o_street',type='string', length = 64 ),
Field('o_post',type='string', length = 64 ),
Field('o_city',type='string', length = 64 ),
Field('o_state',type='string', length = 64 ),
Field('o_country',type='string', length = 64 ),
Field('o_TaxNumber',type='string', length = 64 ),
Field('o_rootid',type='integer' ),
Field('o_parentid',type='integer' ),
Field('o_levelid',type='integer'),
Field('o_positionx',type='string', length = 64 ),
Field('o_positiony',type='string', length = 64 ),
Field('o_note',type = 'text'),
migrate=settings.migrate)
auth.define_tables(migrate = settings.migrate)
On user profile only field organization is shown, but no additional fields
any suggestions what am I doing wrong??
thank you
--
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/groups/opt_out.