[Python] Extract details from Integrity error in Django

Discussão em 'Python' iniciado por Stack, Agosto 12, 2025.

  1. Stack

    Stack Membro Participativo

    I'm getting integrity error from Django in below format

    ForeignKeyViolation('insert or update on table "foo_bar" violates foreign key constraint "foo_obj_product_id_97ae618a_fk_designman"\nDETAIL: Key (product_id)=(9bb7fd8c-2ed2-4a75-ab08-c749459a5097) is not present in table "foo_product".\n'


    Is there any inbuilt method to extract the "details"?

    Continue reading...

Compartilhe esta Página