Skip to content

Commit 7314aa9

Browse files
authored
Remove model_fields and model_config from sphinx documentation (#952)
* Remove model_fields and model_config from sphinx documenation * Use proper docstring
1 parent 132dffa commit 7314aa9

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

docs/conf.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,21 @@
8282
"sphinx_rtd_theme",
8383
]
8484

85+
86+
def skip_pydantic_internals(app, what, name, obj, skip, options):
87+
"""
88+
This processor is used to filter out Pydantic internal attributes from the
89+
documentation.
90+
"""
91+
if name in ("model_fields", "model_config"):
92+
return True
93+
return skip
94+
95+
96+
def setup(app):
97+
app.connect("autodoc-skip-member", skip_pydantic_internals)
98+
99+
85100
# Add any paths that contain templates here, relative to this directory.
86101
templates_path = ["_templates"]
87102

0 commit comments

Comments
 (0)