[web2py] Re: After upgrade to 2.8.2: class 'sqlite3.IntegrityError' foreign key constraint failed

2013-12-06 Thread Loïc
Hi Scott I don't fully understand you answer. Could you please show us what was your buggy code, and how you solved it? I'm still stuck with this problem... Thanks a lot -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code)

[web2py] Re: After upgrade to 2.8.2: class 'sqlite3.IntegrityError' foreign key constraint failed

2013-12-05 Thread Loïc
The workaround for me was to specify adapter_args=dict(foreign_keys=False) in the DAL connection. For example : db = DAL('sqlite://storage.sqlite', pool_size=1, lazy_tables=True, migrate=True, adapter_args=dict(foreign_keys=False)) Le jeudi 5 décembre 2013 06:48:52 UTC+1, Vch H a écrit : How

[web2py] Re: After upgrade to 2.8.2: class 'sqlite3.IntegrityError' foreign key constraint failed

2013-12-04 Thread Paolo Valleri
Web2py 2.8.2 comes with foreign_keys=ON enabled by default (see http://www.sqlite.org/foreignkeys.html) If you get the issue you mentioned I guess you are violating a foreign key constrain. Please post your model (or the tables definitions involved) so that we can figure out what is wrong

[web2py] Re: After upgrade to 2.8.2: class 'sqlite3.IntegrityError' foreign key constraint failed

2013-12-04 Thread Scott Hunter
Aha -- I had reference fields, one of which was empty, and they used the default validator, which does not allow for that. I specified the validators for those fields, and that did the trick. Shouldn't this have been reported as an error in the form (Field Required, or somesuch), and not

[web2py] Re: After upgrade to 2.8.2: class 'sqlite3.IntegrityError' foreign key constraint failed

2013-12-04 Thread Vch H
I have this problem too. Where I should specified validators? On Wednesday, December 4, 2013 6:00:43 PM UTC+2, Scott Hunter wrote: Aha -- I had reference fields, one of which was empty, and they used the default validator, which does not allow for that. I specified the validators for

[web2py] Re: After upgrade to 2.8.2: class 'sqlite3.IntegrityError' foreign key constraint failed

2013-12-04 Thread Scott Hunter
This was how I modified one of the offending Field definitions: Field('f_club2', type='reference t_club', requires=IS_EMPTY_OR(IS_IN_DB(db,db.t_club.id,%(f_desc)s)), label=T('ClubCode2')), Basically, I wrapped a IS_EMPTY_OR around what the manual says is the default

[web2py] Re: After upgrade to 2.8.2: class 'sqlite3.IntegrityError' foreign key constraint failed

2013-12-04 Thread Alex Glaros
Is there any indicator regarding which exact foreign key constraint it is, or do I have to check each table and field in the problem controller? thanks, Alex Glaros -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] Re: After upgrade to 2.8.2: class 'sqlite3.IntegrityError' foreign key constraint failed

2013-12-04 Thread Vch H
How I can change foreign_keys=ON to OFF for some application? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are