Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • E eScriptorium
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 81
    • Issues 81
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 5
    • Merge requests 5
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • scripta
  • eScriptorium
  • Issues
  • #353
Closed
Open
Issue created May 19, 2021 by Bastien Abadie@x-BAbadiDeveloper

Use a Many-to-Many relation between Document and OCRModel

The goal is to convert the OcrModel.document Foreign Key to an OcrModel.documents Many-to-Many relation towards Document instances.

This means several low-level changes:

  • an OcrModel would then be usable across multiple documents
  • a document would still be usable across multiple OcrModel instance
  • the OcrModel.owner user would be the administrator of the model, no access rights could be easily extracted/aggregated from documents

A M2M "through" model named OcrModelDocument would be created, only to store the relationship between OcrModel and Document alongside a created date (it's easier to do that from the beginning than a later migration to add it).

The OcrModelDocument model would also store boolean states descritbing the interactions between an OcrModel and a Document:

  • trained_on would be used when the model has been trained on the document
  • executed_on would be used when the model has been executed on the document to produce results

A unique constraing on document_id and model_id would ensure than only one M2M relation is possible between a model and a document.

This kind of changes can break a lot of functionalities in small ways, so we would need to fix the behaviour of (at least) these parts:

  • document creation interface
  • training tasks
  • access control to models and documents
  • API OcrModelViewSet and its usage

At this stage, we only update the database and surrounding code, reproducing current behaviour. The resulting code should be mergeable as-is and serve as basis for features development.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking