[web2py] Re: SQLForm.grid : is it possible to delete multiple rows at once ?

2012-09-10 Thread Mandar Vaze
On Monday, March 26, 2012 4:38:57 PM UTC+5:30, Sanjeet Kumar wrote: > > can use the following :- > > form=SQLFORM.grid(db.auth_user, create=False, selectable = lambda ids: > del_emp(ids)) > > def del_emp(ids): > if not ids: > response.flash='Please Select the Check-bo

[web2py] Re: SQLForm.grid : is it possible to delete multiple rows at once ?

2012-03-26 Thread Sanjeet Kumar
can use the following :- form=SQLFORM.grid(db.auth_user, create=False, selectable = lambda ids: del_emp(ids)) def del_emp(ids): if not ids: response.flash='Please Select the Check-box to Delete' else: for row in ids: db(db.au

Re: [web2py] Re: SQLForm.grid : is it possible to delete multiple rows at once ?

2012-03-26 Thread Sebastien Stormacq
Thanks ! On Saturday, March 24, 2012 5:26:52 AM UTC+1, Javier wrote: > > sabsto > > You can use selectable, for example: > > selectable = lambda ids: delete(ids) > form=SQLFORM.grid(query,​selectable=selectable) > > def delete(ids): > to_delete=db(db.tabla.id.​belongs(ids)) > to_delete.del

Re: [web2py] Re: SQLForm.grid : is it possible to delete multiple rows at once ?

2012-03-24 Thread Anthony
> > You can use selectable, for example: > > selectable = lambda ids: delete(ids) > form=SQLFORM.grid(query,​selectable=selectable) > > def delete(ids): > to_delete=db(db.tabla.id.​belongs(ids)) > to_delete.delete() > Nice. Forgot about that.

Re: [web2py] Re: SQLForm.grid : is it possible to delete multiple rows at once ?

2012-03-23 Thread Javier Pepe
sabsto You can use selectable, for example: selectable = lambda ids: delete(ids) form=SQLFORM.grid(query,selectable=selectable) def delete(ids): to_delete=db(db.tabla.id.belongs(ids)) to_delete.delete() On Fri, Mar 23, 2012 at 9:46 PM, Derek wrote: > Or you could avoid javascript,

[web2py] Re: SQLForm.grid : is it possible to delete multiple rows at once ?

2012-03-23 Thread Derek
Or you could avoid javascript, store the IDs of the "deleted" items in the session and do your own calls to the DAL to delete items. On Friday, March 23, 2012 7:33:42 AM UTC-7, Anthony wrote: > > Is it possible to select and delete multiple rows with one button click >> using SQLFORM.grid ? (in

[web2py] Re: SQLForm.grid : is it possible to delete multiple rows at once ?

2012-03-23 Thread Anthony
> > Is it possible to select and delete multiple rows with one button click > using SQLFORM.grid ? (instead of clicking delete on each row) > I tried the "selectable" property but this doesn't help to delete. > I searched the archive of this group / mailing-list without success > Not out of the