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

-- 

--- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to