Mentions légales du service

Skip to content

Replace the FK towards Document on OcrModel by a M2M relation

Eva Bardou requested to merge db-ocrmodel-refactoring into develop

Closes #353 (closed)

This MR implements the refactoring of the OcrModel.document ForeignKey into a ManyToMany relation towards Document instances:

  • I generated a core migration (0045) to implement the M2M relation aswell as the OcrModelDocument M2M "through" model. Note that this migration also uses a RunPython function to migrate existing OcrModel.document links to match the new schema.
  • I filled the Django Administration Panel with the new model (OcrModelDocument) and added some inlines on Document and OcrModel to easily browse relations.
  • Last, I fixed all broken behaviors introduced by previous changes.

Please review and test heavily any behavior that might have been impacted by the provided changes.

Edited by Eva Bardou

Merge request reports