ghostforge/ghostforge/models.py
2023-05-23 17:14:49 -07:00

27 lines
669 B
Python

import datetime
from pydantic import BaseModel
from pydantic import Field
class UserSchema(BaseModel):
name: str = Field(...)
password: str = Field(...)
created: datetime.datetime = datetime.datetime
class Config:
schema_extra = {
"example": {
"name": "Jeremy Tootsieroll",
"password": "notarealpassword",
"created": "2021-03-05T08:21:00.000Z",
}
}
class UserLoginSchema(BaseModel):
name: str = Field(...)
password: str = Field(...)
class Config:
schema_extra = {"example": {"name": "Jeremy Tootsieroll", "password": "notarealpassword"}}