Mentions légales du service

Skip to content
Snippets Groups Projects

Replace the FK towards Document on OcrModel by a M2M relation

Merged Eva Bardou requested to merge db-ocrmodel-refactoring into develop
All threads resolved!

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.

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

Edited by Eva Bardou

Merge request reports

Merged by Robin TissotRobin Tissot 3 years ago (May 21, 2021 2:16pm UTC)

Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Tested locally, code looks good, I was able to create a new document and link a model

  • Eva Bardou added 1 commit

    added 1 commit

    • fc30c48b - Add OcrModelDocumentInlines in Django admin

    Compare with previous version

  • Eva Bardou resolved all threads

    resolved all threads

  • Eva Bardou marked this merge request as ready

    marked this merge request as ready

  • Eva Bardou changed the description

    changed the description

  • Eva Bardou requested review from @rtissot

    requested review from @rtissot

  • Robin Tissot
  • Robin Tissot
    • Resolved by Eva Bardou

      Haven't tested yet but the code is clean, I made two small remarks.

      Sorry for the missing migration, it was dealt with in the Project PR but I should just have pushed it in develop.

  • Eva Bardou added 4 commits

    added 4 commits

    • 181d57d8 - 1 commit from branch develop
    • 024987ad - Replace the FK towards Document on OcrModel by a M2M relation
    • d13f6a69 - Fix all broken behaviours introduced by the previous commit
    • f724f9cb - Add OcrModelDocumentInlines in Django admin

    Compare with previous version

  • Eva Bardou changed the description

    changed the description

  • Eva Bardou added 1 commit

    added 1 commit

    • bfa1ab45 - Fix some review related code snippets

    Compare with previous version

  • Eva Bardou resolved all threads

    resolved all threads

  • Robin Tissot added 2 commits

    added 2 commits

    • d21d57f0 - Fixes model versioning.
    • a6ed6457 - Fixes binding a model to a document when creating it through the api and passes all api tests.

    Compare with previous version

  • Robin Tissot mentioned in commit 48c706b7

    mentioned in commit 48c706b7

  • merged

  • Please register or sign in to reply
    Loading