I want to select only authenticated teachers' students on the form. But I
could not find how to filter. Can you help?
Best,
Murat.

###
db.define_table(
    'session_header',
    Field('session_date', type="date", label='Session Date'),
    Field('teacher', 'reference auth_user', notnull=True, readonly=True,
default=auth.user_id),
    Field('student', 'reference student', notnull=True),
    auth.signature)

def create():
    form = SQLFORM(session_header)
    if form.process().accepted:
        response.flash = "Record inserted successfully."
    elif form.errors:
        response.flash = "Please correct the form errors."
    response.view = 'sessions/create.html'
    return dict(form=form)

-- 
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 web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/CAC5t_JwTrntyb8LSQ-%3DYcTEEcuK2K2zuOUxw4sQgTQLLbDtw2A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to