Good day!
I decided to ask new question since Anthony solve my problem.
Based on the given code here. I want to display the actual value not the ID when displaying the data in SQLFORM.grid.
School Year Adviser Student 1 walker 1
Note: walker is the username
this data retrieving is ok but I want is more in informative way.
I want to display in SQLFORM.grid are like this:
School Year Adviser Student 2015-16-1 Walker, Paul Doe, John
is this possible in SQLFORM.grid?
these are the codes before calling the SQLFORM.grid
db.stud_adviser.sy_id.default= db.school_year.sy
db.stud_adviser.adv_id.default= db.auth_user.last_name
db.stud_adviser.stud_id.default= db.student_list.lastname
but still the result is the same:
School Year Adviser Student 1 walker 1
nothing happen. BUT when editing the data using SQLFORM.grid the result are working. Because these are the codes I used.
db.stud_adviser.sy_id.requires= IS_IN_DB(db, 'school_year.id', '%(sy)s')
db.stud_adviser.adv_id.requires=IS_IN_DB(db,'auth_user.id', '%(last_name)s')
db.stud_adviser.stud_id.requires=IS_IN_DB(db,'student_list.id', '%(lastname)s')
but as a programmer you don't want the user to view the students (currently we have 300+ infoTech students) one by one by clicking the edit in SQLFORM.grid just to know who is Student # 1, what School Year is # 1 and who is the Adviser that uses the walker username.