Loïc
unread,Feb 1, 2013, 10:20:54 AM2/1/13Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to web...@googlegroups.com
Dear All,
I have a 'page' model with a sef-reference:
db.define_table('page',
Field('parent', 'reference page', readable=False, writable=False),
Field('title', unique=True, notnull=True)
//more fields not important here
)
When I insert a new page via appadmin without specifying a 'parent', everything is OK with sqlite
Since I moved my database to mysql, I have an error :
<class '_mysql_exceptions.IntegrityError'> (1452, 'Cannot add
or update a child row: a foreign key constraint fails
(`dommartin25`.`page`, CONSTRAINT `page_ibfk_1` FOREIGN KEY (`parent`)
REFERENCES `page` (`id`) ON DELETE CASCADE)')
How can I allow null values for the 'parent' field?
Thank you