please use dict() when you deal with smartgrid that reference to another table
e.g. not tested def dailycounts():
fields = dict(daily_counts = [db.daily_counts.add_date, db.daily_counts.encrypt_count,
db.daily_counts.decrypt_count, db.daily_counts.error_count,
db.daily_counts.directory_create_count, db.daily_counts.client_add_count],
history = [db.history.client_id_dc, db.history.add_date, db.history.encryption_type,
db.history.out_filename] )
orderby = dict(daily_counts = ~db.dalily_counts.add_date, history = ~db.history.add_date)
# similar to create = False, but you can make it flexible e.g. daily_counts = True, history = False
create = dict(daily_counts = False, history = False)
# similar to editable = False, but you can make it flexible e.g. daily_counts = True, history = False
editable = dict(daily_counts = False, history = False)
# similar to deletable = False, but you can make it flexible e.g. daily_counts = True, history = False
deletable = dict(daily_counts = False, history = False)
grid = SQLFORM.smartgrid(db.daily_counts, user_signature = False, create = create, editable = editable,
deletable = deletable, paginate = 10, orderby = orderby, fields = fields )