i have this table as follows:db.define_table([elided])
to writable = false to prevent user inputting the data in this field because it will call another script to get the the data for mode attributei will have the form to ask the user to input info into these fields except mode field because i will call another script to get the data of the mode from the other table and input the mode data along with the input data from user. my question is where should i call the script to get the mode data? ( is it the in the form.process().accepted block. ?). how can i insert the mode data at the same time when the user click submit to insert the inputs into the table ?Please help, Thanks
Hi Dave, could you please elaborate more since the book doesn't explain my situation well.Thanks
Hi, but the things is i set the mode field to writable false, do you think i am still able to access the mode by form.vars.mode?
On Monday, June 10, 2019 at 3:15:11 PM UTC-7, Quang Lam wrote:Hi Dave, could you please elaborate more since the book doesn't explain my situation well.Thanks
Hmmm, does that "other script" run server-side or client-side? I forgot about that question.
/dps
On Monday, June 10, 2019 at 2:23:33 PM UTC-7, Dave S wrote:
On Monday, June 10, 2019 at 1:04:41 PM UTC-7, Quang Lam wrote:
i have this table as follows:
db.define_table( 'Pass', Field('FlightID', 'reference Flight', label=T('Flight'), requires=IS_NOT_EMPTY()),Field('AnalystID', 'reference Analyst', label=T('Analyst'), requires=IS_NOT_EMPTY()),Field('TypeID', 'reference Type', label=T('Type'), requires=IS_NOT_EMPTY()),Field('Name', label=T('Pass Name'),requires=IS_NOT_EMPTY()),Field('Configuration', label=T('Configuration')),Field('PostedToCustomer', label=T('Posted To Customer'), type='boolean'),Field('PassNote', label=T('Pass Note'), type='text'),Field('AnalysisNote', label=T('Analysis Note'), type='text'),Field('Mode', label=T('Mode'), writable=False, type='text')) // field mode is set to writable = false to prevent user inputting the data in this field because it will call another script to get the the data for mode attribute
i will have the form to ask the user to input info into these fields except mode field because i will call another script to get the data of the mode from the other table and input the mode data along with the input data from user. my question is where should i call the script to get the mode data? ( is it the in the form.process().accepted block. ?). how can i insert the mode data at the same time when the user click submit to insert the inputs into the table ?Please help, Thanks
Hi Dave, if i set the mode field to readable false and writable true, how i can display the mode field in the view page. i know we can make it temporarily readable true but i dont know how.Please help.
On Monday, June 10, 2019 at 4:11:25 PM UTC-7, Quang Lam wrote:Hi Dave, if i set the mode field to readable false and writable true, how i can display the mode field in the view page. i know we can make it temporarily readable true but i dont know how.Please help.
I'm going to wait to answer until I can access a system that isn't at the same site I am right now.
if form.process().accepted:
print form.vars
set form.vars.PostDate to request.now.date()
thisrow - db(mytable.id == form.vars.id).select().first()
thisrow.update_record(PostDate = form.vars.PostDate)