- Updated README to include KodBox in project vision. - Added model descriptions for clarity in Download, File, Folder, Group, Node, Order, Policy, Redeem, Report, Request, Response, Setting, Share, SourceLink, StoragePack, Tag, Task, User, and WebDAV. - Changed optional fields from Optional[...] to the new union type syntax (e.g., str | None). - Improved foreign key references in models for consistency. - Refactored relationships in models to use singular forms where appropriate. - Updated login service to reflect changes in request model types.
19 lines
558 B
Python
19 lines
558 B
Python
|
|
from typing import TYPE_CHECKING
|
|
from sqlmodel import Field, Relationship
|
|
from .base import TableBase
|
|
|
|
if TYPE_CHECKING:
|
|
from .share import Share
|
|
|
|
class Report(TableBase, table=True):
|
|
"""举报模型"""
|
|
|
|
reason: int = Field(description="举报原因代码")
|
|
description: str | None = Field(default=None, max_length=255, description="补充描述")
|
|
|
|
# 外键
|
|
share_id: int = Field(foreign_key="share.id", index=True, description="被举报的分享ID")
|
|
|
|
# 关系
|
|
share: "Share" = Relationship(back_populates="reports") |