Re: [web2py] Re: Mysterious key error

2016-01-23 Thread Seraaj Muneer
If I take out common_filter=lambda query: db.bank.company_id == get_default_company_id() from the table definition, everthing works just fine. On Saturday, 23 January 2016 18:10:54 UTC, Seraaj Muneer wrote: > > To be clear, I didn't insert the last line > > response

Re: [web2py] Re: Mysterious key error

2016-01-23 Thread Seraaj Muneer
To be clear, I didn't insert the last line response ._vars=response ._caller(banks) in the controller. Web2py did that. On Saturday, 23 January 2016 18:06:23 UTC, Seraaj Muneer wrote:

Re: [web2py] Re: Mysterious key error

2016-01-23 Thread Seraaj Muneer
Unfortunately refactoring to db.define_table('company', Field('name', 'string', length=20, represent=lambda name, row: name.upper(), required=True, unique=True, notnull=True, ), Field('is_default'

Re: [web2py] Re: Mysterious key error

2016-01-23 Thread Anthony
On Saturday, January 23, 2016 at 1:22:52 AM UTC-5, Seraaj Muneer wrote: > > It appears that placing the 'common_filter' in the table definition > together with the speical field 'request_tenant' is problematic. However, > doing > > > db.bank.common_filter = lambda query: db.bank.company_id == >

Re: [web2py] Re: Mysterious key error

2016-01-22 Thread Seraaj Muneer
It appears that placing the 'common_filter' in the table definition together with the speical field 'request_tenant' is problematic. However, doing db.bank.common_filter = lambda query: db.bank.company_id == get_default_company_id() seem to also work with no issues. On Saturday, 23

Re: [web2py] Re: Mysterious key error

2016-01-22 Thread Seraaj Muneer
I think I figured it out. Using the field property 'common_filter' AND the special field 'requst_filter' on the same table is what was causing it. Removing one of those fixed the issue for me. On Saturday, 23 January 2016 06:07:02 UTC, Seraaj Muneer wrote: > > Web2py 2.13.4. Essentially the cod

Re: [web2py] Re: Mysterious key error

2016-01-22 Thread Seraaj Muneer
Web2py 2.13.4. Essentially the code in the original post here is all there is in the app. Initially, it was working just fine, then it suddenly stopped with that error. On Saturday, 23 January 2016 04:14:47 UTC, Anthony wrote: > > What version of web2py? Can you attach a minimal app that reprod

Re: [web2py] Re: Mysterious key error

2016-01-22 Thread Anthony
What version of web2py? Can you attach a minimal app that reproduces the problem? On Friday, January 22, 2016 at 6:26:18 PM UTC-5, Seraaj Muneer wrote: > > That was just a typing error when I was writing the message here. It's > actually correctly defined in my code. > On 22 Jan 2016 23:08, "Der

Re: [web2py] Re: Mysterious key error

2016-01-22 Thread Saeed
That was just a typing error when I was writing the message here. It's actually correctly defined in my code. On 22 Jan 2016 23:08, "Derek" wrote: > company_field_id and company_id_field are not the same. Look closely. > > On Friday, January 22, 2016 at 3:29:47 PM UTC-7, Seraaj Muneer wrote: >> >