The problem is that the grid expects the field to be writable in the form. 
You do not include them therefore it thinks they are empty (html 
convention, not web2py's).

Assuming you want the fields in the "create" form but not in the edit form 
you can replace:

    grid = SQLFORM.grid(db.person.id>0,
                        fields=[db.person.first, db.person.last])

with

    if request.args(0) == 'edit':
        db.person.song.writable = False
        db.person.tv_show.writable = False
    grid = SQLFORM.grid(db.person.id>0,
                        fields=[db.person.first, db.person.last])

On Friday, 14 June 2013 08:54:59 UTC-5, Jim S wrote:
>
> Here you go.  Attached.
>
> -Jim
>
>
> On Thursday, June 13, 2013 10:46:58 PM UTC-5, Massimo Di Pierro wrote:
>>
>> Can we see an example?
>>
>> On Thursday, 13 June 2013 16:32:34 UTC-5, Jim S wrote:
>>>
>>> It is possible that I'm losing my mind, but it appears to me that when I 
>>> submit a SQLFORM.grid update with a custom form that fields not included in 
>>> the custom form are being set to NULL even if they had a value in them 
>>> before.
>>>
>>> I've just noticed this after updating to 2.5.1 stable.
>>>
>>> -Jim
>>>
>>

-- 

--- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to