File size: 795 Bytes
57cf043
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
from datetime import datetime

from sqlalchemy import (
    String,
)
from sqlalchemy.orm import Mapped, relationship, mapped_column
from components.dbo.models.base import Base

class Document(Base):
    """
    Сущность, которая хранит основную информацию о документе.
    """

    __tablename__ = "document"

    filename: Mapped[str] = mapped_column(String)
    source_format: Mapped[str] = mapped_column(String)
    title: Mapped[str] = mapped_column(String)
    status: Mapped[str] = mapped_column(String)
    owner: Mapped[str] = mapped_column(String)

    datasets: Mapped[list["DatasetDocument"]] = relationship(
        'DatasetDocument', back_populates='document'
    )
    acronyms = relationship("Acronym", back_populates="document")