Added create_entity
Some checks failed
checks-impure / test (pull_request) Successful in 30s
checks / test (pull_request) Failing after 3h13m7s

This commit is contained in:
2023-11-26 20:54:57 +01:00
parent 80ccaa83d3
commit d1a3a5381a
8 changed files with 200 additions and 128 deletions

View File

@@ -1,54 +0,0 @@
from enum import Enum
from pydantic import BaseModel, Field
class Status(Enum):
ONLINE = "online"
OFFLINE = "offline"
UNKNOWN = "unknown"
class Machine(BaseModel):
name: str
status: Status
class RepositoryBase(BaseModel):
title: str
description: str | None = None
class RepositoryCreate(RepositoryBase):
pass
class Repository(RepositoryBase):
id: int
prod_id: str
class Config:
orm_mode = True
class ProducerBase(BaseModel):
id: int
class ProducerCreate(ProducerBase):
jsonblob: int = Field(
42,
title="The Json",
description="this is the value of json",
gt=30,
lt=50,
list=[1, 2, "3"],
)
class Producer(ProducerBase):
id: int
repos: list[Repository] = []
class Config:
orm_mode = True