> What are you trying to achieve?
>

what i want to achieve is in registration form using sqlform, the doctor 
field is showing drop down menu form field list of user that have roles 
doctor.

What is the function of db.registration.requires...  in this context?
>
 
db.registration.requires is for form validation so that the doctor field is 
showing drop down menu form field list of user that have roles doctor
 

> Where did you put this code?  Is this in your model or controller?
>

i put it on models :
models/db_wizard_4_registration.py

roles is of the type 'list of integers'  and 'Doctor'  is a string.
>

yes, i know, that's why i test it both (string and integer) but got the 
same result (no error occured, just output not expected) :
db.registration.doctor.requires = IS_IN_DB(db(roles == 'Doctor'), 
db.auth_user.id,  '%(first_name)s %(last_name)s')
#db.registration.doctor.requires = IS_IN_DB(db(roles == 3), db.auth_user.id, 
 '%(first_name)s %(last_name)s')

What is the content of db.registration?
>
 
db.define_table('registration', 
Field('registration_no'),
Field('registration_date', 'date'),
Field('patient', 'reference patient'),
Field('doctor', 'reference auth_user'),
# Field('doctor', 'reference auth_membership'),
Field('status'),
on_define = on_define_registration, 
format = '%(registration_no)s') 

any ideas how to achieve this?

thanks and best regards,
stifan

-- 
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/groups/opt_out.

Reply via email to