[models] simplify model hierarchy by removing one intermediate layer
This commit is contained in:
parent
4236f39515
commit
f622a58214
1 changed files with 2 additions and 7 deletions
|
|
@ -11,18 +11,13 @@ from sqlmodel import (
|
|||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class TeilchenBase(SQLModel):
|
||||
text: str
|
||||
|
||||
|
||||
class TeilchenCreate(TeilchenBase):
|
||||
class TeilchenCreate(SQLModel):
|
||||
description: str | None
|
||||
name: str = Field(index=True)
|
||||
number: int = Field(default=1)
|
||||
text: str
|
||||
tags: str | None
|
||||
|
||||
text: str # The original input as entered by the user
|
||||
|
||||
|
||||
class Teilchen(TeilchenCreate, table=True):
|
||||
id: uuid.UUID = Field(default_factory=uuid.uuid7, primary_key=True)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue