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
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
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
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
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
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
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
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']
8 matches
Mail list logo