[web2py] Re: SQLFORM.grid ondelete possible bug

2011-11-28 Thread Massimo Di Pierro
I figured out what the problem is. in SQLFORM.grid ret = db(table.id==request.args[-1]).delete() if ondelete: return ondelete(table,request.args[-1],ret) the record is deleted before ondelete is called. This was for conformity with the oncreate and onupdate

[web2py] Re: SQLFORM.grid ondelete possible bug

2011-11-28 Thread Casey Schroeder
Also let me say that I was able to get around this problem - to suit my purposes, but not those who need ondelete - originally with a hack to .grid. In the case in question, i don't really want to delete the item. I want to remove it for the user in question. To do this, originally, I added anot

[web2py] Re: SQLFORM.grid ondelete possible bug

2011-11-17 Thread Casey Schroeder
Thanks Massimo, I am trying this: delmem = lambda table, itid, ct: auth.del_membership(auth.id_group("auth_group_1"), table[int(itid)].userid) SQLFORM.grid(...ondelete=delmem...) table[int(itid)] however, is returning a none type, so the userid is inaccessible in this way. An exception is

[web2py] Re: SQLFORM.grid ondelete possible bug

2011-11-16 Thread Massimo Di Pierro
Hello Casey, Can you show us your test? On Nov 16, 1:14 pm, Casey Schroeder wrote: > There may be an update on this that i missed, but can I ask if this > fix is sufficient? > > I believe that the ret parameter is the effected row count, correct? > > If you just deleted the record, can you reliab

[web2py] Re: SQLFORM.grid ondelete possible bug

2011-11-16 Thread Casey Schroeder
There may be an update on this that i missed, but can I ask if this fix is sufficient? I believe that the ret parameter is the effected row count, correct? If you just deleted the record, can you reliably retrieve it from the table and record id in ondelete, i.e. before a subsequent commit? My *

[web2py] Re: SQLFORM.grid ondelete possible bug

2011-10-27 Thread Massimo Di Pierro
fixed On Oct 26, 4:54 pm, Bob St John wrote: > using 1.99.2 > > in gluon.sqlhtml.SQLFORM.grid: > > line 1489: return ondelete(table,request.args[-2],ret) > > I think it should be: return ondelete(table,request.args[-1],ret) > > As it is now, ondelete gets (table, table, ret), whereas I believe i