Try this in controller:

for field in db.t_bills.fields: db.tbills[field].writable = False
db.tbills.f_name.writable = True
form = SQLFORM(db.t_bills, bill['id'])
...
...

(I did not test it yet, I guess it works)

--
Bruno Rocha
[ About me: http://zerp.ly/rochacbruno ]



2011/4/27 Kenneth Lundström <[email protected]>

> I have a table that I悲 like to update. Let愀 say the table has eight
> different columns but at the time I悲 like to only update one of them via a
> form.
>
> in controller:
> form = SQLFORM(db.t_bills, bill['id'])
>
> if form.accepts(request.vars, session, keepvalues=True):
>        redirect()
>
> return dict(form=form)
>
>
> in view:
> I have created a custom view with
> {{=form.custom.begin}}
> {{=form.custom.widget.f_name}}
> {{=form.custom.submit}}
> {{=bill_items_form.custom.end}}
>
> So I have only one textfield that can be updated. The problem I惴 facing is
> that all rest columns are updated to a NULL value. I tried with
> SQLFORM(db.fsdf, fields but no luck.
>
>
> Kenneth
>
>

Reply via email to