<class 'sqlite3.IntegrityError'> foreign key constraint failed

866 views
Skip to first unread message

Anna Kostikova

unread,
Sep 22, 2014, 5:01:11 PM9/22/14
to web...@googlegroups.com
Hi everyone,

I am having an issue when editing content of one of the tables in my database. When I try to edit a record in the table I have an error message "<class 'sqlite3.IntegrityError'> foreign key constraint failed". The bizarre thing is that it doesn't matter which column I am trying to edit (via appadmin control panel) - i have exactly same message. For instance, I have a column "description" that doesn't have any keys on it (or references), but I can't edit the content of this field and I keep getting the error above.

What might be causing the issue?
I am using python 2.7.7 and web2py 2.9.5

Thanks
Anna

Fabiano Almeida

unread,
Sep 24, 2014, 3:31:13 PM9/24/14
to web...@googlegroups.com
If your table definitions are right, try delete database and run your app again...

--
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 subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Leonel Câmara

unread,
Sep 24, 2014, 4:00:30 PM9/24/14
to web...@googlegroups.com
Seems like a botched migration to me. Can you tell me what changes you made to your model, and a sample of the data you had there before?

Cliff Kachinske

unread,
Sep 26, 2014, 6:10:33 PM9/26/14
to web...@googlegroups.com
This post on StackOverflow may help http://stackoverflow.com/questions/9636053/is-there-a-way-to-get-the-constraints-of-a-table-in-sqlite

There is a code snippet you might try.
Reply all
Reply to author
Forward
0 new messages