mirror of
https://github.com/kennethreitz/pydantic.git
synced 2026-06-05 23:00:18 +00:00
9 lines
197 B
Python
9 lines
197 B
Python
from pydantic import BaseModel, create_model
|
|
|
|
DynamicFoobarModel = create_model('DynamicFoobarModel', foo=(str, ...), bar=123)
|
|
|
|
|
|
class StaticFoobarModel(BaseModel):
|
|
foo: str
|
|
bar: int = 123
|