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