diff --git a/custom_templates/pydantic_v2/BaseModel.jinja2 b/custom_templates/pydantic_v2/BaseModel.jinja2 deleted file mode 100644 index bf7357d..0000000 --- a/custom_templates/pydantic_v2/BaseModel.jinja2 +++ /dev/null @@ -1,39 +0,0 @@ -{% for decorator in decorators -%} -{{ decorator }} -{% endfor -%} -class {{ class_name }}({{ base_class }}, table=True):{% if comment is defined %} # {{ comment }}{% endif %} -{%- if description %} - """ - {{ description | indent(4) }} - """ -{%- endif %} -{%- if not fields and not description %} - pass -{%- endif %} -{%- if config %} -{%- filter indent(4) %} -{% include 'ConfigDict.jinja2' %} -{%- endfilter %} -{%- endif %} -{%- for field in fields -%} - {%- if not field.annotated and field.field %} - {{ field.name }}: {{ field.type_hint }} = {{ field.field }} - {%- else %} - {%- if field.annotated %} - {{ field.name }}: {{ field.annotated }} - {%- else %} - {{ field.name }}: {{ field.type_hint }} - {%- endif %} - {%- if (not field.required or field.data_type.is_optional or field.nullable) and not field.annotated - %} = {{ field.represented_default }} - {%- endif -%} - {%- endif %} - {%- if field.docstring %} - """ - {{ field.docstring | indent(4) }} - """ - {%- endif %} -{%- for method in methods -%} - {{ method }} -{%- endfor -%} -{%- endfor -%} \ No newline at end of file diff --git a/custom_templates/pydantic_v2/RootModel.jinja2 b/custom_templates/pydantic_v2/RootModel.jinja2 deleted file mode 100644 index 5b5a9f2..0000000 --- a/custom_templates/pydantic_v2/RootModel.jinja2 +++ /dev/null @@ -1,44 +0,0 @@ -{%- macro get_type_hint(_fields) -%} -{%- if _fields -%} -{#There will only ever be a single field for RootModel#} -{{- _fields[0].type_hint}} -{%- endif -%} -{%- endmacro -%} - -{% for decorator in decorators -%} -{{ decorator }} -{% endfor -%} - -class {{ class_name }}({{ base_class }}[{{get_type_hint(fields)}}]):{% if comment is defined %} # {{ comment }}{% endif %} -{%- if description %} - """ - {{ description | indent(4) }} - """ -{%- endif %} -{%- if config %} -{%- filter indent(4) %} -{% include 'ConfigDict.jinja2' %} -{%- endfilter %} -{%- endif %} -{%- if not fields and not description %} - pass -{%- else %} - {%- set field = fields[0] %} - {%- if not field.annotated and field.field %} - root: {{ field.type_hint }} = {{ field.field }} - {%- else %} - {%- if field.annotated %} - root: {{ field.annotated }} - {%- else %} - root: {{ field.type_hint }} - {%- endif %} - {%- if not (field.required or (field.represented_default == 'None' and field.strip_default_none)) - %} = {{ field.represented_default }} - {%- endif -%} - {%- endif %} - {%- if field.docstring %} - """ - {{ field.docstring | indent(4) }} - """ - {%- endif %} -{%- endif %} \ No newline at end of file diff --git a/custom_templates/root.jinja2 b/custom_templates/root.jinja2 deleted file mode 100644 index 847a823..0000000 --- a/custom_templates/root.jinja2 +++ /dev/null @@ -1,6 +0,0 @@ -{%- set field = fields[0] %} -{%- if field.annotated %} -{{ class_name }} = {{ field.annotated }} -{%- else %} -{{ class_name }} = {{ field.type_hint }} -{%- endif %}