feat: Enhance models and README with additional features and improvements
- 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.
This commit is contained in:
@@ -1,20 +1,19 @@
|
||||
|
||||
from typing import Optional, TYPE_CHECKING
|
||||
from sqlmodel import Field, Relationship, Column, func, DateTime
|
||||
from typing import TYPE_CHECKING
|
||||
from sqlmodel import Field, Relationship
|
||||
from .base import TableBase
|
||||
from datetime import datetime
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from .share import Share
|
||||
|
||||
class Report(TableBase, table=True):
|
||||
__tablename__ = 'reports'
|
||||
"""举报模型"""
|
||||
|
||||
reason: int = Field(description="举报原因代码")
|
||||
description: Optional[str] = Field(default=None, max_length=255, description="补充描述")
|
||||
description: str | None = Field(default=None, max_length=255, description="补充描述")
|
||||
|
||||
# 外键
|
||||
share_id: int = Field(foreign_key="shares.id", index=True, description="被举报的分享ID")
|
||||
share_id: int = Field(foreign_key="share.id", index=True, description="被举报的分享ID")
|
||||
|
||||
# 关系
|
||||
share: "Share" = Relationship(back_populates="reports")
|
||||
Reference in New Issue
Block a user