mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
feat: inot blocks + schemas updates
This commit is contained in:
parent
e6adbca562
commit
b04fd64c92
8 changed files with 250 additions and 264 deletions
|
|
@ -5,16 +5,16 @@ from enum import Enum
|
|||
|
||||
|
||||
class BlockTypeEnum(str, Enum):
|
||||
QUIZ_BLOCK = "QUIZ_BLOCK"
|
||||
VIDEO_BLOCK = "VIDEO_BLOCK"
|
||||
DOCUMENT_PDF_BLOCK = "DOCUMENT_PDF_BLOCK"
|
||||
IMAGE_BLOCK = "IMAGE_BLOCK"
|
||||
CUSTOM = "CUSTOM"
|
||||
BLOCK_QUIZ = "BLOCK_QUIZ"
|
||||
BLOCK_VIDEO = "BLOCK_VIDEO"
|
||||
BLOCK_DOCUMENT_PDF = "BLOCK_DOCUMENT_PDF"
|
||||
BLOCK_IMAGE = "BLOCK_IMAGE"
|
||||
BLOCK_CUSTOM = "BLOCK_CUSTOM"
|
||||
|
||||
|
||||
class BlockBase(SQLModel):
|
||||
id: Optional[int] = Field(default=None, primary_key=True)
|
||||
block_type: BlockTypeEnum = BlockTypeEnum.CUSTOM
|
||||
block_type: BlockTypeEnum = BlockTypeEnum.BLOCK_CUSTOM
|
||||
content: dict = Field(default={}, sa_column=Column(JSON))
|
||||
|
||||
|
||||
|
|
@ -29,9 +29,11 @@ class Block(BlockBase, table=True):
|
|||
creation_date: str
|
||||
update_date: str
|
||||
|
||||
|
||||
class BlockCreate(BlockBase):
|
||||
pass
|
||||
|
||||
|
||||
class BlockRead(BlockBase):
|
||||
id: int
|
||||
org_id: int = Field(default=None, foreign_key="organization.id")
|
||||
|
|
@ -41,4 +43,4 @@ class BlockRead(BlockBase):
|
|||
block_uuid: str
|
||||
creation_date: str
|
||||
update_date: str
|
||||
pass
|
||||
pass
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue