oops. yes. I edited it for posterity.
On Thursday, 18 July 2013 10:48:15 UTC-5, lesssugar wrote:
>
> Although, I guess in the last line it should be
>
> record.update_record(fieldname = request.vars.fieldname)
>
> instead of
>
> record.update_record(fieldname = record.fieldname)
>
> Cheers!
>
> On Thursday, July 18, 2013 5:31:10 PM UTC+2, Massimo Di Pierro wrote:
>>
>> record = db(db.tablename.id==id).select().first()
>> form = SQLFORM.factory(Field('fieldname',default = record.fieldname))
>> if form.process().accepted:
>> record.update_record(fieldname = record.fieldname)
>>
>>
>> On Thursday, 18 July 2013 09:19:17 UTC-5, lesssugar wrote:
>>>
>>> I have a table with 8 fields. I need to create crud.update form only for
>>> one of them.
>>>
>>> There are at least two ways to do it:
>>>
>>> 1. setting readable / writable attributes of the rest 7 fields to False
>>> (rather tedious)
>>>
>>> 2. or something like this:
>>>
>>> for f in db.tablename.fields:
>>> if f != 'myfield':
>>> db.tablename.f.writable = db.tablename.f.readable = False
>>>
>>> but of course I can't concentrate DAL objects and string like this ;)
>>> How do I do it properly?
>>>
>>
--
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.