I am afraid this is not possible because HTML cannot distinguish an empty 
submission from no submission. Somehow we have to tell that explicitly to 
web2py. Perhaps there is a better way to do it but I do not see on. :-(


On Sunday, 16 June 2013 15:35:27 UTC-5, Jim S wrote:
>
> I thought I could just use whatever fields I wanted and it would figure 
> out which ones to update.  The way it is now, if I add a field to a table 
> and it isn't included in the writable = False statements the It is going to 
> be set to null on any future updates.  I would prefer to not have to worry 
> about updating all custom forms if I should add a field to a table sometime 
> in the future. 
>  
> Jim
> On Jun 16, 2013 3:32 PM, "Massimo Di Pierro" 
> <massimo....@gmail.com<javascript:>> 
> wrote:
>
>> How do you think it should work? If we can make it better we will.
>>
>> On Sunday, 16 June 2013 15:02:28 UTC-5, Jim S wrote:
>>>
>>> I was hoping I wouldn't have to do that but I understand.  I think it 
>>> should be pointed out in the manual that this needs to be done so others 
>>> don't make the same mistake I did. 
>>>
>>> Thanks Massimo, I really appreciate the reply. 
>>>
>>> Jim
>>>  On Jun 16, 2013 3:41 AM, "Massimo Di Pierro" <massimo....@gmail.com> 
>>> wrote:
>>>
>>>> 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 a topic in the 
>>>> Google Groups "web2py-users" group.
>>>> To unsubscribe from this topic, visit https://groups.google.com/d/**
>>>> topic/web2py/EiAy_w4BLxY/**unsubscribe<https://groups.google.com/d/topic/web2py/EiAy_w4BLxY/unsubscribe>
>>>> .
>>>> To unsubscribe from this group and all its topics, send an email to 
>>>> web2py+un...@**googlegroups.com.
>>>> For more options, visit 
>>>> https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
>>>> .
>>>>  
>>>>  
>>>>
>>>  -- 
>>  
>> --- 
>> You received this message because you are subscribed to a topic in the 
>> Google Groups "web2py-users" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/web2py/EiAy_w4BLxY/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> web2py+un...@googlegroups.com <javascript:>.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>  
>>  
>>
>

-- 

--- 
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