| Total Complexity | 0 |
| Total Lines | 30 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | from beanie import Document |
||
| 2 | from typing import Optional |
||
| 3 | |||
| 4 | |||
| 5 | class DBWorkspace(Document): |
||
| 6 | """ |
||
| 7 | Model to store a workspace in the mongo-database. |
||
| 8 | |||
| 9 | Information to handle workspaces and from bag-info.txt are stored here. |
||
| 10 | |||
| 11 | Attributes: |
||
| 12 | ocrd_identifier Ocrd-Identifier (mandatory) |
||
| 13 | bagit_profile_identifier BagIt-Profile-Identifier (mandatory) |
||
| 14 | ocrd_base_version_checksum Ocrd-Base-Version-Checksum (mandatory) |
||
| 15 | ocrd_mets Ocrd-Mets (optional) |
||
| 16 | bag_info_adds bag-info.txt can also (optionally) contain additional |
||
| 17 | key-value-pairs which are saved here |
||
| 18 | """ |
||
| 19 | workspace_id: str |
||
| 20 | workspace_mets_path: str |
||
| 21 | ocrd_identifier: str |
||
| 22 | bagit_profile_identifier: str |
||
| 23 | ocrd_base_version_checksum: Optional[str] |
||
| 24 | ocrd_mets: Optional[str] |
||
| 25 | bag_info_adds: Optional[dict] |
||
| 26 | deleted: bool = False |
||
| 27 | |||
| 28 | class Settings: |
||
| 29 | name = "workspace" |
||
| 30 |