Re: [web2py] Making a field non-editable, but writable using SQLFORM

2011-06-16 Thread Jay Shaffstall
That doesn't seem to affect the HTML form output at all for me. I've also tried changing the widget to LABEL, but that results in the same problem with the value not being transmitted back via the form. What I'd like to be able to do is set the readonly attribute of the input tag; but I don't kno

Re: [web2py] Making a field non-editable, but writable using SQLFORM

2011-06-16 Thread Bruno Rocha
Sorry, I answered before read entire message, if you want to chamhe it in form only, better to use the 'represent' attribute db.table.field.represent = lambda f: " %s " % f -- Bruno Rocha [ About me: http://zerp.ly/rochacbruno ] On Thu, Jun 16, 2011 at 3:05 PM, Jay Shaffstall wrote: > I ha

Re: [web2py] Making a field non-editable, but writable using SQLFORM

2011-06-16 Thread Bruno Rocha
You can change this on the fly, no need to do it only in models, it can be done in controllers. ### controllers/comecontroller.py db.table.field.writable = False # change the field to writable false form = SQLFORM(db.table) # build the form db.table.field.writable = True #change it again ret

[web2py] Making a field non-editable, but writable using SQLFORM

2011-06-16 Thread Jay Shaffstall
I have a situation where I need to adjust an SQLFORM field to be non-editable. I can do that with .writable = False, but that seems to also prevents database I/O for that field. What I'm trying to do is set a default that cannot be changed. Is there a way to set an SQLFORM field so that it appea