from fastapi import Form, UploadFile from pydantic import BaseModel, Field from dataclasses import dataclass class CreateCarPart(BaseModel): ParentId: int = Form(...) Name: str = Form(...) Number: str = Form(...) Condition: str = Form(...) Cost: float = Form(...) image: UploadFile = Form(...) class ShowCarPart(BaseModel): ParentId: int = Field(...) Name: str = Field(...) Number: str = Field(...) Condition: str = Field(...) Cost: float = Field(...) image: str = Field(...)