How to capture auth_user.id during registration
Code is below. No error message but the value is "None" instead of the
auth_user.id
It correctly captures first_name and last_name from auth_user form vars.
form=SQLFORM.factory(db.SuperObject,db.Party,db.auth_user,db.PartyAddressIntersection,db.Address)
if form.process().accepted:
response.flash='Thanks for filling the form'
form.vars.displayName = form.vars.objectDisplayName =
'%(first_name)s %(last_name)s' % form.vars
form.vars.superObjectID =
db.SuperObject.insert(**db.SuperObject._filter_fields(form.vars))
form.vars.partyID =
db.Party.insert(**db.Party._filter_fields(form.vars))
db.auth_user.insert(**db.auth_user._filter_fields(form.vars))
form.vars.addressID =
db.Address.insert(**db.Address._filter_fields(form.vars))
db.PartyAddressIntersection.insert(**db.PartyAddressIntersection._filter_fields(form.vars))
theMessage = 'newly registered user: ' + ' ' + str(request.now)
+ ' ' + '%(auth_user.id)s %(first_name)s %(last_name)s' % form.vars
theSubject = 'newly registered user'
mail.send(to='[email protected]', subject=theSubject,
message=theMessage)
redirect(URL('/user/login'))
return dict(form=form)
thanks,
Alex Glaros
--
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.