Maybe Massimo's ideia can work for you.

But don't be afraid to count on custom forms. They give us much more power.



On 07/17/2012 12:37 PM, Massimo Di Pierro wrote:
Doesn't

db.table.field.writable = False
db.table.field.default = 'whatever'

do what you want?

On Thursday, 16 June 2011 13:05:34 UTC-5, JayShaffstall wrote:

    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 appears as a label
    on the form itself, but is still writable for the database?

    For reference, I'm doing this with a field in the form returned by
    auth.register, so I cannot insert code between the form creation and
    the accepts call.  I believe I'm restricted to working with the model
    before calling auth.register, or by using custom forms.

    Jay

--




--



Reply via email to