Massimo - This is "beautiful" --- I'm starting to see this sort of idiom...
....represent = ..... A( {some visual/text repr}, _href= (some desired action,some parameters)) Really - this is starting to look easy.... I'm feeling the time to write! :-) Merry Christmas! Yarko On Thu, Dec 25, 2008 at 12:35 PM, mdipierro <mdipie...@cs.depaul.edu> wrote: > > This is the problem: > > TD(A('delete!',_href=self.delete > (db.t2_comment,query=db.t2_comment.id== > row.id,next='run/pending_comments'))))) > > "self.delete(...)" performs the delete. > > You need to: > > 1) create an action like > > @t2.requires_login() > def delete_comment(): t2.delete(db.t2_comment,next='run/ > pending_comments') > > 2) edit the line above and turn it to > > db.t2_comment.represent=lambda row: TABLE( > TR(TD('Author'),TD('Body')), > TR(TD(row.created_signature),TD(row.body), > TD(A('approve!',_href=self.action > ('approve_comment',row.id))), > TD(A('delete!',_href=t2.action > ('delete_comment,row.id),next='run/pending_comments'))))) > > > > > > On Dec 25, 11:53 am, "Tito Garrido" <titogarr...@gmail.com> wrote: > > Hi folks, > > > > I'm trying to create a represent function for t2_comment using the follow > > method: > > db.t2_comment.represent=lambda row: TABLE( > > TR(TD('Author'),TD('Body')), > > TR(TD(row.created_signature),TD(row.body), > > > TD(A('approve!',_href=self.action('approve_comment', > > row.id))), > > > > TD(A('delete!',_href=self.delete(db.t2_comment,query=db.t2_comment.id== > > row.id,next='run/pending_comments'))))) > > > > But when I try to renderize this itemize its deletes all posts... > > > > am I doing something wrong? > > > > Thanks, > > > > Tito > > > > -- > > Linux User #387870 > > .........____ > > .... _/_õ|__| > > ..º[ .-.___.-._| . . . . > > .__( o)__( o).:_______ > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---