cf770f4814
(cherry picked from commit e57abdbef7e13e3880738cd639225df5db0c37be)
28 lines
729 B
Python
28 lines
729 B
Python
from typing import Optional
|
|
import uuid
|
|
from datetime import datetime
|
|
|
|
from sqlalchemy import func
|
|
from sqlalchemy.orm import DeclarativeBase, Mapped, mapped_column
|
|
|
|
|
|
class Base(DeclarativeBase):
|
|
pass
|
|
|
|
|
|
class BaseMixin:
|
|
id: Mapped[str] = mapped_column(primary_key=True, default=str(uuid.uuid4()))
|
|
created_date: Mapped[datetime] = mapped_column(default=func.now())
|
|
last_modified_date: Mapped[datetime] = mapped_column(default=func.now())
|
|
version: Mapped[int] = mapped_column(default=0)
|
|
|
|
|
|
class BaseVideoMixin:
|
|
cloud_link: Mapped[Optional[str]]
|
|
file_name: Mapped[Optional[str]]
|
|
path: Mapped[str]
|
|
review: Mapped[bool]
|
|
title: Mapped[str]
|
|
url: Mapped[str]
|
|
should_download: Mapped[bool]
|