Replace the FK towards Document on OcrModel by a M2M relation
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 theOcrModelDocument
M2M "through" model. Note that this migration also uses aRunPython
function to migrate existingOcrModel.document
links to match the new schema. - I filled the Django Administration Panel with the new model (
OcrModelDocument
) and added some inlines onDocument
andOcrModel
to easily browse relations. - Last, I fixed all broken behaviors introduced by previous changes.