feat: inot blocks + schemas updates

This commit is contained in:
swve 2023-11-16 22:37:09 +01:00
parent e6adbca562
commit b04fd64c92
8 changed files with 250 additions and 264 deletions

View file

@ -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