I think delete is working without problems. I have found the way how to
execute delete without the problems. The problem is how to parse delete
action.
Currently URL for button ends with #null. This is URL I receive when point
to Delete button:
https://<host>/ssc/admin/admin_devices/5#null
but it should be:
https://<host>/ssc/admin/admin_devices/5/delete/device/73
If I change callback URL to button URL I see URL correctly but warning
("Are you sure ...?") is not showing any more.
I have reported issue http://code.google.com/p/web2py/issues/detail?id=1247
Boris
Dne četrtek, 27. december 2012 05:41:26 UTC+1 je oseba Mandar Vaze napisala:
>
>
>
> On Thu, Dec 27, 2012 at 5:18 AM, Massimo Di Pierro
> <[email protected]<javascript:>
> > wrote:
>
>> Can you please open a ticket about this?
>
>
> There is already one opened for this :
> http://code.google.com/p/web2py/issues/detail?id=1234
> Unless your email was meant for Boris and his buttonurl code change. (It
> it addresses same problem, so same issue can be used ?)
>
> -Mandar
>
>
>>
>> On Wednesday, 26 December 2012 13:40:15 UTC-6, BJ wrote:
>>>
>>> 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',
>>> ca**llback=url(args=['delete', tablename, id
>>> ]),
>>> de**lete='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
>>>>
>>> --
>>
>>
>>
>>
>
>
--