Re: [web2py] Re: Setting a default reference value as that of a specific group the logging in user is a member of

2020-02-26 Thread villas
Naturally you can still use auth to identify the user. The auth groups is really just to identify the type of user, e.g. teachers, students, admins. This is useful for allowing access to certain functionality. You must still design your DB and create links between your tables using

Re: [web2py] Re: Setting a default reference value as that of a specific group the logging in user is a member of

2020-02-26 Thread AGRogers
Thanks for the extra info. In my scenario I have schools, teachers, subjects, classes and students. At the Classes level there will be hundreds eventually (new ones each term). Your school limits what subjects you can see. The teacher limits what classes she can see etc. If I understood you

[web2py] Re: Setting a default reference value as that of a specific group the logging in user is a member of

2020-02-25 Thread 'Annet' via web2py-users
I don't understand the use of field 'groups' and function 'get_groups() I think you should use web2py's built in auth_ functionality: drop field 'groups' in both tables, link users and groups (each hotel its own group) in the auth_membership table, and use this table to create a list of options

[web2py] Re: Setting a default reference value as that of a specific group the logging in user is a member of

2020-02-25 Thread mostwanted
How do I set it as a default if the form is not open by a link redirection? The form is opened directly by the main-menu. If it were opened through the link then it'd be easy to set the hotel as a default coz all i'd do would be: *hotel=db(db.hotel_profile(request.args(0,

[web2py] Re: Setting a default reference value as that of a specific group the logging in user is a member of

2020-02-25 Thread villas
Set the default hotel value in the SQLFORM field. You could also 'force' the hotel you want by using SQLFORM onvalidation On Tuesday, 25 February 2020 07:28:31 UTC, mostwanted wrote: > > I have 2 tables