Where does this IntegrityError comes from on the Django ORM on MySQL? -
i have django 1.5 site running mysql db on cent os, , 1 of views used worked started fail on snippet :
ipdb> video.objects.create(owner=usr, category=category, status="processing", title=request.post.get('title')) *** integrityerror: (1452, 'cannot add or update child row: foreign key constraint fails (`project`.`videos_manager_video`, constraint `category_id_refs_id_26102a51` foreign key (`category_id`) references `videos_manager_category (`id`))')
the code hasn't changed, data base hasn't changed , ran mysqlcheck (it said tables ok), still explodes.
of course checked category
, proper category object, proper id. doing this:
category.objects.get(id=cated.id)
returns same categ.
we purged cache, juste in case, still no go.
what cause ? solve ?
Comments
Post a Comment