thank you Anthony for the explanation .. 
I tried to do it that way, but it does not work .. what am I doing wrong ???

def testpage():
>    STEPS = {0: ('Iagreeto','first_name','last_name','email','password',
> 'sex','birth_date','usertype'), # fields for 1st table and first step
>             1: ('user_adrss','user_city','user_prov','user_postalcode',
> 'Country'),     # fields for 2nd table and 2nd step
>             2: ('language_spoken','Other_language','user_picture',
> 'user_description','user_story'),  # fields for the final table and 3rd 
> step
>             3: URL('done')}
>    
>    step = int(request.args(0) or 0)
>    if not step in STEPS: redirect(URL(args=0))
>    fields = STEPS[step]
>    if step==0:
>       session.testpage = {}
>    if isinstance(fields,tuple):
>       mytables = ['auth_user','user_location', 'user_profile']
>       form_fields = []
>       [form_fields.extend([db[t][f] for f in db[t].fields if f in fields]) 
> for t in mytables]
>       form = SQLFORM.factory(*form_fields)
>
>
>    if form.accepts(request,session):
>       session.wizard.update(form.vars)
>       redirect(URL(args=step+1))
>    else:
>       for k in mytables :
>          db[k].insert(**session.testpage)
>       session.flash = T('wizard completed')
>       redirect(fields)
>    return dict(form=form,step=step) 
>
> and it does not work .... what am I doing wrong ...
>

-- 



Reply via email to