From 62812749d587da4882154593cc1892a0c4539f60 Mon Sep 17 00:00:00 2001 From: Marek Wolan Date: Wed, 12 Mar 2025 12:01:25 +0000 Subject: [PATCH] 3110 - change docs custom class template to remove things inherited from basemodel --- docs/_templates/custom-class-template.rst | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/docs/_templates/custom-class-template.rst b/docs/_templates/custom-class-template.rst index 71e992bc..c9ad7420 100644 --- a/docs/_templates/custom-class-template.rst +++ b/docs/_templates/custom-class-template.rst @@ -12,7 +12,8 @@ .. autoclass:: {{ objname }} :members: :show-inheritance: - :inherited-members: + :inherited-members: BaseModel + :exclude-members: model_computed_fields, model_config, model_fields :special-members: __init__, __call__, __add__, __mul__ {% block methods %} @@ -22,7 +23,14 @@ .. autosummary:: :nosignatures: {% for item in methods %} - {%- if not item.startswith('_') %} + {%- if not item.startswith('_') and item not in [ + 'construct', 'copy', 'dict', 'from_orm', 'json', 'model_construct', + 'model_copy', 'model_dump', 'model_dump_json', 'model_json_schema', + 'model_parametrized_name', 'model_post_init', 'model_rebuild', '', + 'model_validate', 'model_validate_json', 'model_validate_strings', + 'parse_file', 'parse_obj', 'parse_raw', 'schema', 'schema_json', + 'update_forward_refs', 'validate', + ] %} ~{{ name }}.{{ item }} {%- endif -%} {%- endfor %} @@ -35,7 +43,12 @@ .. autosummary:: {% for item in attributes %} + {%- if not item.startswith('_') and item not in [ + 'model_computed_fields', 'model_config', 'model_extra', 'model_fields', + 'model_fields_set', + ] %} ~{{ name }}.{{ item }} + {%- endif -%} {%- endfor %} {% endif %} {% endblock %}