And if you only need one field from ten in an update form you may consider
this :

for f in db.tabe.fields:
    db.table[f].readable = False
    db.table[f].writable = False

Then you put to True the field you want to update...

Richard

On Mon, Sep 14, 2015 at 2:16 PM, Richard Vézina <[email protected]
> wrote:

> No, no, no, before the crud.update()
>
> I think it may work either after, but it more safe and coherent before the
> form definition (before crud.something).
>
> Richard
>
> On Mon, Sep 14, 2015 at 1:47 PM, Diego Tostes <[email protected]>
> wrote:
>
>> def controler_update():
>>    from gluon.tools import Crud
>>    crud = Crud(db)
>>
>>
>>
>>  crud.update(db.tablename,
>>             id)
>>
>>
>>
>>  db.tablename.field.readable = False
>>  db.tablename.field.editable = False
>>
>>  return dict(form=crud())
>>
>>
>> 2015-09-14 14:37 GMT-03:00 Diego Tostes <[email protected]>:
>>
>>> like this:
>>>
>>> def controler_update():
>>>    from gluon.tools import Crud
>>>    crud = Crud(db)
>>>
>>>
>>>
>>>  crud.update(db.tablename,
>>>             db.tablename.field.readable = False,
>>>             db.tablename.field.editable = False,
>>>             id)
>>>
>>>  return dict(form=crud())
>>>
>>>
>>> regards
>>>
>>> diego
>>>
>>> 2015-09-14 13:49 GMT-03:00 Richard Vézina <[email protected]>:
>>>
>>>> I you want to prevent some fields to appears and be created/updated in
>>>> your form put this in you controller before form declaration :
>>>>
>>>> db.table.field.readable = False
>>>> db.table.field.writeable = False
>>>>
>>>> Richard
>>>>
>>>> On Mon, Sep 14, 2015 at 12:47 PM, Diego Tostes <[email protected]
>>>> > wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> I neew to create a form to edit a existing table element, but i do not
>>>>> want to expose all the fields of the table to update.
>>>>>
>>>>> is that possiblem using sqlform or crud form? or i need to build a
>>>>> custom form at the viw and create a controler to update the table?
>>>>>
>>>>> rgds
>>>>> diego
>>>>>
>>>>> --
>>>>> Resources:
>>>>> - http://web2py.com
>>>>> - http://web2py.com/book (Documentation)
>>>>> - http://github.com/web2py/web2py (Source code)
>>>>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>>>>> ---
>>>>> 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/d/optout.
>>>>>
>>>>
>>>> --
>>>> Resources:
>>>> - http://web2py.com
>>>> - http://web2py.com/book (Documentation)
>>>> - http://github.com/web2py/web2py (Source code)
>>>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>>>> ---
>>>> 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/d/optout.
>>>>
>>>
>>>
>> --
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> ---
>> 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/d/optout.
>>
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.

Reply via email to