it's work now, even in the tuple inside the list data type, my bad to treat the list data type in an unproper manner, hehe
is_in_set list checkboxes refer to rows table database
e.g.
def attendance_form():
target_response = "jQuery('#attendance_checkout').get(0).reload()"
list_employee = []
for row_list_employee in rows_list_employee:
list_employee.append(data_employee)
form = SQLFORM.factory(
Field('employee', 'list:string',
widget = SQLFORM.widgets.checkboxes.widget,
requires = [IS_IN_SET(list_employee, multiple = True), IS_NOT_EMPTY() ] ),
)
if form.process(formname = 'form_detail').accepted:
response.flash = T('Form accepted')
for row_id in request.vars.employee:
id = int(row_id)
(db.attendance.attendance_date == request.now) )
row_attendance = db(query_attendance).iterselect().first()
if row_attendance:
response.flash = T("Employee already insert today")
else:
basic_salary = int(row_employee.basic_salary)
meal = int(row_employee.meal)
transport = int(row_employee.transport)
total = basic_salary + meal + transport
session_attendance[id] = basic_salary, meal, transport, total
response.js = target_response
is_in_set list checkboxes for view report (not related with database table)
e.g.
def product_form():
redirect_url = 'report_product'
list_show_product = [('chart', T('Chart') ),
('account', T('Account') ) ]
form = SQLFORM.factory(
Field("product", "reference product",
zero = T('Choose One') ) ),
Field('show', 'list:string',
widget = SQLFORM.widgets.checkboxes.widget,
requires = IS_IN_SET(list_show_product, multiple = True) ) )
if form.process().accepted:
product = form.vars.product
show = form.vars.show
show.insert(0, product)
response.new_window = URL(redirect_url, args = show)