[web2py] Re: helper function - query returns no rows

2014-01-12 Thread zee
Ok, your comment took a little time to sink in, but I think I got it now. I modified the function to take in account form.vars.npc set to None. I think it works now, Thanks ! On Saturday, January 11, 2014 10:56:56 AM UTC+1, zee wrote: > > Hi, > > First post here, so thanks in advance for any help

[web2py] Re: helper function - query returns no rows

2014-01-12 Thread zee
Ok, I will take that into account. In any case, I have tried calling the function with actual values that are the DB as following : onrp_id = get_onrp(1000, 'Lausanne', 12) just to ensure the function works, but without success. On Saturday, January 11, 2014 10:56:56 AM UTC+1, zee wrote:

[web2py] Re: helper function - query returns no rows

2014-01-12 Thread Anthony
On Sunday, January 12, 2014 2:43:33 PM UTC-5, zee wrote: > > I believe the function definition : > def get_onrp(npa, lns, npc=0): > does set the value of npc to 0 if the argument is not passed to the > function call. > Yes, but your code always passes form.vars.npc as the third argument, so that

[web2py] Re: helper function - query returns no rows

2014-01-12 Thread zee
I believe the function definition : def get_onrp(npa, lns, npc=0): does set the value of npc to 0 if the argument is not passed to the function call. On Saturday, January 11, 2014 10:56:56 AM UTC+1, zee wrote: > > Hi, > > First post here, so thanks in advance for any help provided. > > I have a s

[web2py] Re: helper function - query returns no rows

2014-01-12 Thread zee
Sorry, maybe I wasn't clear, this is the original code : if form.vars.npa_complement: pass else: form.vars.npa_complement = 0 onrp_row = db( (db.npa.npa==form.vars.npa) & (db.npa.loc_name_short==form.vars.lns) & (db.npa.

[web2py] Re: helper function - query returns no rows

2014-01-11 Thread Anthony
I notice in your original code, you set form.vars.npc to 0 if it is empty -- does your new code do the same? We might need to see all the code. Anthony On Saturday, January 11, 2014 4:56:56 AM UTC-5, zee wrote: > > Hi, > > First post here, so thanks in advance for any help provided. > > I have a