Skip to content

Commit 3db51e0

Browse files
committed
feat: add use_attribute_docstrings pydantic config for improved docstrings
1 parent d460c5d commit 3db51e0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

sqlmodel/main.py

+6
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,12 @@ def get_config(name: str) -> Any:
576576
# TODO: remove this in the future
577577
set_config_value(model=new_cls, parameter="read_with_orm_mode", value=True)
578578

579+
# enables field-level docstrings on the pydanatic `description` field, which we then copy into
580+
# sa_args, which is persisted to sql table comments
581+
set_config_value(
582+
model=new_cls, parameter="use_attribute_docstrings", value=True
583+
)
584+
579585
config_registry = get_config("registry")
580586
if config_registry is not Undefined:
581587
config_registry = cast(registry, config_registry)

0 commit comments

Comments
 (0)