基本更新
This commit is contained in:
parent
222a424822
commit
3b025a2eca
|
|
@ -8,7 +8,8 @@
|
|||
.LSOverride
|
||||
|
||||
# Icon must end with two \r
|
||||
Icon
|
||||
Icon
|
||||
|
||||
|
||||
# Thumbnails
|
||||
._*
|
||||
|
|
@ -318,4 +319,7 @@ poetry.toml
|
|||
# LSP config files
|
||||
pyrightconfig.json
|
||||
|
||||
# VScode setting files
|
||||
.vscode/
|
||||
|
||||
# End of https://www.toptal.com/developers/gitignore/api/python,pycharm,macos
|
||||
|
|
|
|||
|
|
@ -0,0 +1,34 @@
|
|||
from tortoise import fields
|
||||
from tortoise.models import Model
|
||||
|
||||
class CommentFr(Model):
|
||||
id = fields.IntField(pk=True)
|
||||
user = fields.ForeignKeyField("models.User", related_name="comments_fr")
|
||||
comment_text = fields.TextField(description="The comment text")
|
||||
comment_word = fields.ForeignKeyField("models.WordlistFr", related_name="comments_fr")
|
||||
created_at = fields.DatetimeField(auto_now_add=True)
|
||||
updated_at = fields.DatetimeField(auto_now=True)
|
||||
|
||||
class Meta:
|
||||
table = "comments_fr"
|
||||
|
||||
class CommentJp(Model):
|
||||
id = fields.IntField(pk=True)
|
||||
user = fields.ForeignKeyField("models.User", related_name="comments_jp")
|
||||
comment_text = fields.TextField(description="The comment text")
|
||||
comment_word = fields.ForeignKeyField("models.WordlistJp", related_name="comments_jp")
|
||||
created_at = fields.DatetimeField(auto_now_add=True)
|
||||
updated_at = fields.DatetimeField(auto_now=True)
|
||||
supervised = fields.BooleanField(default=False)
|
||||
|
||||
class Meta:
|
||||
table = "comments_jp"
|
||||
|
||||
class ImprovingComment(Model):
|
||||
id = fields.IntField(pk=True)
|
||||
user = fields.ForeignKeyField("models.User", related_name="comments_improving")
|
||||
comment_text = fields.TextField(description="The comment text")
|
||||
created_at = fields.DatetimeField(auto_now_add=True)
|
||||
|
||||
class Meta:
|
||||
table = "comments_improving"
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
from typing import List, Tuple
|
||||
from typing import Literal
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
from app.api.user.user_schemas import UserSchema
|
||||
|
||||
|
||||
class CommentPiece(BaseModel):
|
||||
user_id: UserSchema
|
||||
comment_content: str
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
|
||||
class CommentSet(BaseModel):
|
||||
comments: List[Tuple[int, str, str]]
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
|
||||
class CommentUpload(BaseModel):
|
||||
comment_word: str
|
||||
comment_content: str
|
||||
lang: Literal["fr", "jp"]
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
Loading…
Reference in New Issue