@@ -14,28 +14,6 @@ from .list_filters import *
1414
1515# --- Types for model: {{ model.name }} --- #
1616
17- {% set other_models = all_models | selectattr ('name' , 'ne' , model .name ) | list %}
18- {% if other_models %}
19- # Cross-import related model types for type checker resolution
20- if TYPE_CHECKING:
21- {% for other_model in other_models %}
22- from .{{ other_model.name | lower }} import (
23- {{ other_model.name }}WhereInput,
24- {{ other_model.name }}WhereUniqueInput,
25- {{ other_model.name }}OrderByInput,
26- {{ other_model.name }}ScalarFieldKeys,
27- {{ other_model.name }}RelationFilter,
28- {{ other_model.name }}ListRelationFilter,
29- {{ other_model.name }}CreateWithoutRelationsInput,
30- {{ other_model.name }}CreateNestedWithoutRelationsInput,
31- {{ other_model.name }}CreateManyNestedWithoutRelationsInput,
32- {{ other_model.name }}UpdateOneWithoutRelationsInput,
33- {{ other_model.name }}UpdateManyWithoutRelationsInput,
34- {{ other_model.name }}ConnectOrCreateWithoutRelationsInput,
35- )
36- {% endfor %}
37- {% endif %}
38-
3917
4018{% set depth = generator .config .recursive_type_depth %}
4119
@@ -432,3 +410,24 @@ class {{ model.name }}NumberAggregateInput(TypedDict, total=False):
432410{% else -%}
433411 {{ model.name }}RelationalFieldKeys = _NoneType
434412{% endif %}
413+
414+ {% set other_models = all_models | selectattr ('name' , 'ne' , model .name ) | list %}
415+ {% if other_models %}
416+ # Cross-import related model types for resolution of forward references
417+ {% for other_model in other_models %}
418+ from .{{ other_model.name | lower }} import (
419+ {{ other_model.name }}WhereInput,
420+ {{ other_model.name }}WhereUniqueInput,
421+ {{ other_model.name }}OrderByInput,
422+ {{ other_model.name }}ScalarFieldKeys,
423+ {{ other_model.name }}RelationFilter,
424+ {{ other_model.name }}ListRelationFilter,
425+ {{ other_model.name }}CreateWithoutRelationsInput,
426+ {{ other_model.name }}CreateNestedWithoutRelationsInput,
427+ {{ other_model.name }}CreateManyNestedWithoutRelationsInput,
428+ {{ other_model.name }}UpdateOneWithoutRelationsInput,
429+ {{ other_model.name }}UpdateManyWithoutRelationsInput,
430+ {{ other_model.name }}ConnectOrCreateWithoutRelationsInput,
431+ )
432+ {% endfor %}
433+ {% endif %}
0 commit comments