[web2py] Re: readonly field only in SQLFORgrid edit page if field is not empty

2016-05-28 Thread Mike Constabel
Am Freitag, 27. Mai 2016 06:48:31 UTC+2 schrieb Anthony: > > def list_order_type(): > if 'edit' in request.args: > record = db.foobar(request.args(-1, cast=int)) > older_than_an_hour = record.created_on < request.now - datetime. > timedelta(hours=1) > db.foobar.text.wr

[web2py] Re: readonly field only in SQLFORgrid edit page if field is not empty

2016-05-26 Thread Anthony
def list_order_type(): if 'edit' in request.args: record = db.foobar(request.args(-1, cast=int)) older_than_an_hour = record.created_on < request.now - datetime. timedelta(hours=1) db.foobar.text.writable = not (record.text and older_than_an_hour) form = SQLFORM.grid

[web2py] Re: readonly field only in SQLFORgrid edit page if field is not empty

2016-05-26 Thread Val K
Where and how can I set the db.foobar.text.writable = False? request.args(1) = 'edit' On Thursday, May 26, 2016 at 12:46:45 PM UTC+3, Mike Constabel wrote: > > Hello, > > I try to find a solutiuon for a hopefully simple problem. > > Example: > > db.define_table("foobar", > Field("uuid", "