MCPcopy Create free account
hub / github.com/PacktPublishing/Full-Stack-FastAPI-React-and-MongoDB / CarBase

Class CarBase

chapter5/backend/models.py:27–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25 json_encoders = {ObjectId: str}
26
27class CarBase(MongoBaseModel):
28
29 brand: str = Field(..., min_length=3)
30 make: str = Field(..., min_length=3)
31 year: int = Field(..., gt=1975, lt=2023)
32 price: int = Field(...)
33 km: int = Field(...)
34 cm3: int = Field(...)
35
36class CarUpdate(MongoBaseModel):
37 price: Optional[int] = None

Callers 1

importScript.pyFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected