Re: [web2py] Re: SQLFORM.smartgrid oncreate,ondelete not firing

2013-03-15 Thread Cliff Kachinske
One way to do it is parse the args. ar = request.args # save typing if len(ar) > 2 and ar[-1] == 'mytable' and ar[-2]=='new': # Yes, there is a more concise way to do this with slices oncreate= myfunctiononcreate else: oncreate=None if len(ar) > 3 and isinstance(ar[-1], int) and ar[-2]=='my

Re: [web2py] Re: SQLFORM.smartgrid oncreate,ondelete not firing

2013-03-15 Thread software.ted
So what is the conclusion? how can you fire a callback for a function when a child table has a field added or edited using oncreate and onupdate respectively. On Wednesday, 7 November 2012 14:43:26 UTC+2, vivek wrote: > > Hmmm , > > unsure of how to determine the different table , i tr

Re: [web2py] Re: SQLFORM.smartgrid oncreate,ondelete not firing

2012-11-07 Thread vivek
Hmmm , unsure of how to determine the different table , i tried using forms.vars.net - as this field is unique to my parent table in the same oncreate function. So basically , I have forms.vars.xyz from my child table and able to use it to do what i need. But forms.vars.net is unusabl

Re: [web2py] Re: SQLFORM.smartgrid oncreate,ondelete not firing

2012-11-06 Thread howesc
good question.i don't know the answer to it, but i suspect there is a way in your oncreate method to determine which table just had a creation and do different actions based on that. On Monday, November 5, 2012 11:41:17 PM UTC-8, vivek wrote: > > > Hi , > > So in this case how do I ma

Re: [web2py] Re: SQLFORM.smartgrid oncreate,ondelete not firing

2012-11-05 Thread vivek
Hi , So in this case how do I make sure it fires only when a new record is created for the child table in this case "quotelines" . Suppose if I have 2 different functions to be fired for the parent - oncreate and child - oncreate? Regards, Vivek On Monday, October 29, 2012 11:39:08

Re: [web2py] Re: SQLFORM.smartgrid oncreate,ondelete not firing

2012-10-29 Thread howesc
something like: def myondelete(table, row_id): pass form = SQLFORM.smartgrid(..., ondelete=myondelete, ...) On Sunday, October 28, 2012 6:57:12 AM UTC-7, vivek wrote: > > So how would the new code be? I am a newbie a bit of direction needed! > > > > > On Sun, Oct 28, 2012 at 5:39 PM, Ni

Re: [web2py] Re: SQLFORM.smartgrid oncreate,ondelete not firing

2012-10-28 Thread Vivek Digambernath
So how would the new code be? I am a newbie a bit of direction needed! On Sun, Oct 28, 2012 at 5:39 PM, Niphlod wrote: > oncreate, ondelete, onupdate are callbacks to functions, not dicts > > > On Sunday, October 28, 2012 12:26:39 PM UTC+1, vivek wrote: >> >> Hi, >> >> @auth.requires_logi

[web2py] Re: SQLFORM.smartgrid oncreate,ondelete not firing

2012-10-28 Thread Niphlod
oncreate, ondelete, onupdate are callbacks to functions, not dicts On Sunday, October 28, 2012 12:26:39 PM UTC+1, vivek wrote: > > Hi, > > @auth.requires_login() > def index(): > response.view = 'Final/pricelist.html' > form = SQLFORM.smartgrid(db.sourcelist,linked_tables=['itemowner']