Hello web2py users,
I have made a quick sign up form using SQLFORM.factory,
all the data entered on the various fields of the form are validating
correctly, my error msgs are poping up the way I want ( and not into the
form )
My SQLFORM.factory in the controller index file goes like this ( I have a
login header like facebook ..and a short sign up form similar to facebook
on the index page .. this explains the return of 2 form objects below ) :
def index():
auth.settings.hideerror = True
form = SQLFORM.factory(
Field('first_name', type='string',requires=IS_NOT_EMPTY(
error_message='Field is empty !'),
label=T('First Name')),
Field('last_name', type='string', requires=IS_NOT_EMPTY(
error_message=' Empty Field !!'),
label=T('Last Name')),
Field('email', type='string',
requires=IS_NOT_EMPTY(error_message='Invalid
email address !'),
label=T('E-mail')),
Field('email_check', type='string',requires=IS_EQUAL_TO(request.vars
.email),
label=T('Re-enter E-mail')),
Field('password', type='password',requires=IS_NOT_EMPTY(
error_message='Minimum 6 Alpha Numeric Characters - Should not be empty !'),
readable=False,
label=T('New Password')),
Field('sex',requires=IS_IN_SET((T('male'),T('female'))),label=T('My
Sex is')),
Field('birth_date','date',default=request.now,
widget=select_datewidget,label=T('Birth Date')),
Field('Iagreeto','boolean',requires=IS_NOT_EMPTY(error_message='you
must agree to this !'),
label=T('I agree to the Terms of service, Privacy policy, and
Codes of conduct.')),
hideerror = True)
if form.process().accepted:
response.flash = T('Quick Sign-up Accepted ! - Check your e-mail !')
elif form.errors:
response.flash = T('Quick Sign up form has errors ')
return dict(toplogin_form = auth.login(),quicksignup_form = form)
What I want to do Now :
1) To update the datable table so the same user can sign in whenever !
with SQLFORM it was not a problem it seems it was done automatically ...
but with SQLFORM.factory, because of my need to customise a few things
..... now ...
the data is not going straight into the database table ( db.auth-user )
.. is there a quick way to do this ??? ... without doing it field by
field ? if field by field is a must ...
what about the hidden user's registration timestamp ?? how do I make sure
the timestamp fields are updated correctly ?
Can someone Please assist me a bit ...
thanks
--