mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
18 lines
529 B
Python
18 lines
529 B
Python
from enum import Enum
|
|
from typing import Optional
|
|
from sqlmodel import Field, SQLModel
|
|
|
|
|
|
class ResourceAuthorshipEnum(str, Enum):
|
|
CREATOR = "CREATOR"
|
|
MAINTAINER = "MAINTAINER"
|
|
REPORTER = "REPORTER"
|
|
|
|
|
|
class ResourceAuthor(SQLModel, table=True):
|
|
id: Optional[int] = Field(default=None, primary_key=True)
|
|
resource_uuid: str
|
|
user_id: int = Field(default=None, foreign_key="user.id")
|
|
authorship: ResourceAuthorshipEnum = ResourceAuthorshipEnum.CREATOR
|
|
creation_date: str = ""
|
|
update_date: str = ""
|