[web2py] Re: Prevent user from modifying a form field that already has a default value

2013-11-03 Thread Massimo Di Pierro
student = db.student(row.id) db.student.admission_number.readable = False form = SQLFORM(db.student, student, readonly=True) On Saturday, 2 November 2013 21:43:07 UTC-5, Rupesh Pradhan wrote: > > Model > db.define_table('student', > Field('admission_number', 'integer', notnull=True, unique=Tr

[web2py] Re: Prevent user from modifying a form field that already has a default value

2013-11-02 Thread Rupesh Pradhan
Model db.define_table('student', Field('admission_number', 'integer', notnull=True, unique=True), Field('name', 'string', length=255, notnull=True)) Controller student = db.student(row.id) form = SQLFORM(db.student, student, readonly=True) All the three fields of the table show up when I

[web2py] Re: Prevent user from modifying a form field that already has a default value

2013-11-02 Thread Massimo Di Pierro
Do not use crud.create(table) instead use: form = SQLFORM(table).process() You make it readonly with form = SQLFORM(table,readonly=True) Massimo On Saturday, 2 November 2013 20:45:12 UTC-5, Rupesh Pradhan wrote: > > Also, is there a way of making the entire form read only without having to

[web2py] Re: Prevent user from modifying a form field that already has a default value

2013-11-02 Thread Rupesh Pradhan
Also, is there a way of making the entire form read only without having to make 'writable = False' for each field in that form? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/lis

[web2py] Re: Prevent user from modifying a form field that already has a default value

2013-11-02 Thread Massimo Di Pierro
db.school_session.admission_number.writable = False On Saturday, 2 November 2013 12:28:34 UTC-5, Rupesh Pradhan wrote: > > This is the table definition: > > db.define_table('school_session', > Field('school_session', 'reference session_master'), > Field('admission_number', 'integer', notnu