Fix #4041 -- Fix create_model docstring for custom-specified Fields (#4142)

This commit is contained in:
Hasan Ramezani
2022-08-08 17:38:32 +02:00
committed by GitHub
parent 02a076d14f
commit 42462abf9d
+3 -1
View File
@@ -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 `<name>=(<type>, <default default>)` or `<name>=<default value>, e.g.
`foobar=(str, ...)` or `foobar=123`, or, for complex use-cases, in the format
`<name>=<FieldInfo>`, e.g. `foo=Field(default_factory=datetime.utcnow, alias='bar')`
`<name>=<Field>` or `<name>=(<type>, <FieldInfo>)`, e.g.
`foo=Field(datetime, default_factory=datetime.utcnow, alias='bar')` or
`foo=(str, FieldInfo(title='Foo'))`
"""
if __base__ is not None: