The problem is in sqlhtml.py
In latest version from line 2293-2297 is following content:
if deletable and (not callable(deletable) or deletable(row)):
row_buttons.append(gridbutton(
'buttondelete', 'Delete',
callback=url(args=['delete', tablename, id]),
delete='tr'))
but it should be:
if deletable and (not callable(deletable) or deletable(row)):
row_buttons.append(gridbutton(
'buttondelete', 'Delete',
buttonurl=url(args=['delete', tablename, id]),
<--- Missing line to define URL for Delete button
callback=url(args=['delete', tablename, id]),
<--- We need this for warning message (I believe so?)
delete='tr'))
But we also need to update gridbutton function (line 1806) because we need
button URL and warning. I have tried to add "buttonurl" but now the record
is deleted even if I select "Cancel".
I don't know how to fix this because I don't how to handle callback.
Boris
Dne sreda, 19. december 2012 17:23:18 UTC+1 je oseba Mandar Vaze napisala:
>
> I know it is a tough one, but can you guess what "could" be the problem ?
> As I mentioned, "explicitly" adding db.commit() helps "resolve" the problem
> (Whether in gluon/sqlhtml.py or separately in my custom ondelete)
>
> Does that give you any hints ? I debugged but (obviously) couldn't find
> the culprit.
>
> Any pointers on how to troubleshoot/debug this ? I think at least one more
> person has similar problem (One that started this thread)
>
>
>> Really not relevant all the modify_grid() part. That doesn't belong to
>> web2py, which you are addressing the bug to.
>>
>
> I know. But it was something different - so I thought it may be relevant.
>
>
>> Without the table model, all code is quite useless. We don't need your
>> app. Just *an* app showing the problem.
>>
>
> Ahh, I see. Let me try to create that (app)
>
> -Mandar
>
--