Re: [web2py] Re: What is the problem with mu code

2016-11-24 Thread Joe Lwe
Thanks massimo, Apologies for being such a newbie, just like the user id can be got from the form using the* form.vars.id *, will the group_id = form.vars.account_type. My challenge is getting the account_type value from the registration form when the user registers. Thanks ag

[web2py] Re: What is the problem with mu code

2016-11-19 Thread Massimo Di Pierro
auth.settings.register_onaccept.append(lambda form: auth.add_membership(user_id=form.vars.id, group_id = group_id1) and auth.add_membership(user_id=form.vars.id, group_id = group_id2)) instead of group_id = ... you can specify the name of the group role = 'groupname' On Saturday, 19 November 2

[web2py] Re: What is the problem with mu code

2016-11-19 Thread Joe Lwe
Hi Pierro, I have defined custom groups in db(buyer,seller, individual, non-individual), i want all users who sign up to belong to one or two of the groups that have been defined. My sign up form is as below/attached Thank you so much for the web2py project and your help On Friday, November

[web2py] Re: What is the problem with mu code

2016-11-18 Thread Massimo Di Pierro
not sure where this is called but this is wrong. user_id = request.vars.username auth.add_membership(group_id,user_id) the username is probably not a user_id Can you tell us more about where this is called and what username and account_type are for you? On Sunday, 13 November 2