You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
405 B
Python

from typing import Optional
from datetime import datetime
from pydantic import BaseModel
class RecordBase(BaseModel):
time: Optional[datetime] = datetime.now()
temperature: float
humidity: float
room: str
class Config:
from_attributes = True
class RecordCreate(RecordBase):
pass
class Record(RecordBase):
id: int
class Config:
from_attributes = True