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.
20 lines
351 B
Python
20 lines
351 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):
|
|
pass
|