All players' and coaches' names are stored in auth_user, with roles
(Player, Coach) listed in auth_group and assigned in auth_membership. How
do I define the field "coach" below so that it will allow only those who
have the Coach role? Here's the table definition.
db.define_table('sessions',
Field('program_name', 'string', requires=IS_IN_DB(db,
db.programs.program_name)),
Field('session_type', 'string',
requires=IS_IN_SET(['evaluation', 'practice'], zero=None)),
Field('*coach*', 'string', requires=IS_IN_DB(db,
db.auth_user.id, '%(first_name)s %(last_name)s')),
Field('session_date', 'date'),
Field('session_time', 'time')
)
--
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.