From 75e9443371cc6316637c6985db2010d43b93adfb Mon Sep 17 00:00:00 2001 From: pbrochar <36422268+pbrochar@users.noreply.github.com> Date: Tue, 19 Mar 2024 18:55:56 +0100 Subject: [PATCH] remove unused folder (#36) --- custom_templates/pydantic_v2/BaseModel.jinja2 | 39 ---------------- custom_templates/pydantic_v2/RootModel.jinja2 | 44 ------------------- custom_templates/root.jinja2 | 6 --- 3 files changed, 89 deletions(-) delete mode 100644 custom_templates/pydantic_v2/BaseModel.jinja2 delete mode 100644 custom_templates/pydantic_v2/RootModel.jinja2 delete mode 100644 custom_templates/root.jinja2 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 %}