From 42462abf9ddf86ceda9df30532208c8a5be6e0a1 Mon Sep 17 00:00:00 2001 From: Hasan Ramezani Date: Mon, 8 Aug 2022 17:38:32 +0200 Subject: [PATCH] Fix #4041 -- Fix create_model docstring for custom-specified Fields (#4142) --- pydantic/main.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pydantic/main.py b/pydantic/main.py index 8c0e9f8..9ed4f17 100644 --- a/pydantic/main.py +++ b/pydantic/main.py @@ -950,7 +950,9 @@ def create_model( :param field_definitions: fields of the model (or extra fields if a base is supplied) in the format `=(, )` or `=, e.g. `foobar=(str, ...)` or `foobar=123`, or, for complex use-cases, in the format - `=`, e.g. `foo=Field(default_factory=datetime.utcnow, alias='bar')` + `=` or `=(, )`, e.g. + `foo=Field(datetime, default_factory=datetime.utcnow, alias='bar')` or + `foo=(str, FieldInfo(title='Foo'))` """ if __base__ is not None: