mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
wip: courses
This commit is contained in:
parent
afa8e4ea98
commit
ee07f49139
8 changed files with 334 additions and 378 deletions
|
|
@ -1,29 +1,43 @@
|
|||
from typing import Optional
|
||||
from sqlmodel import Field, SQLModel
|
||||
|
||||
|
||||
class CourseBase(SQLModel):
|
||||
name: str
|
||||
description: Optional[str] = ""
|
||||
about: Optional[str] = ""
|
||||
course_slug: str
|
||||
learnings: Optional[str] = ""
|
||||
tags: Optional[str] = ""
|
||||
thumbnail_image: Optional[str] = ""
|
||||
description: Optional[str]
|
||||
about: Optional[str]
|
||||
learnings: Optional[str]
|
||||
tags: Optional[str]
|
||||
thumbnail_image: Optional[str]
|
||||
public: bool
|
||||
|
||||
|
||||
class Course(CourseBase, table=True):
|
||||
id: Optional[int] = Field(default=None, primary_key=True)
|
||||
org_id: int = Field(default=None, foreign_key="organization.id")
|
||||
course_uuid: str
|
||||
creation_date: str
|
||||
update_date: str
|
||||
|
||||
course_uuid: str = ""
|
||||
creation_date: str = ""
|
||||
update_date: str = ""
|
||||
|
||||
|
||||
class CourseCreate(CourseBase):
|
||||
org_id: int = Field(default=None, foreign_key="organization.id")
|
||||
pass
|
||||
|
||||
|
||||
class CourseUpdate(CourseBase):
|
||||
course_id: int
|
||||
name: str
|
||||
description: Optional[str]
|
||||
about: Optional[str]
|
||||
learnings: Optional[str]
|
||||
tags: Optional[str]
|
||||
public: Optional[bool]
|
||||
|
||||
|
||||
class CourseRead(CourseBase):
|
||||
id: int
|
||||
course_uuid: str
|
||||
creation_date: str
|
||||
update_date: str
|
||||
pass
|
||||
pass
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue