1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
# generated by datamodel-codegen:
# filename: use_frozen_field.json
# timestamp: 2019-07-26T00:00:00+00:00
from __future__ import annotations
from datetime import datetime
from typing import Optional
from pydantic import BaseModel, Field
class User(BaseModel):
class Config:
validate_assignment = True
id: int = Field(..., allow_mutation=False, description='Server-generated ID')
name: str
password: str = Field(..., description='User password')
created_at: Optional[datetime] = Field(None, allow_mutation=False)
|