"""
Imports for generated models and context classes.
"""
# Standard library imports
import uuid
import importlib
from typing import Any, Dict, List, Optional, Type, TypeVar, Union, cast, TypedDict, Generic, Callable
from dataclasses import dataclass, field

# Django and Pydantic imports
from django.db import models
from pydantic import BaseModel

# typed2django base classes (import only those relevant to the current conversion)
{% if generation_source_type == 'pydantic' %}
from typed2django.django.models import Pydantic2DjangoBaseClass, Pydantic2DjangoStorePydanticObject
{% elif generation_source_type == 'dataclass' %}
from typed2django.django.models import Dataclass2DjangoBaseClass
{% elif generation_source_type in ['xml', 'xmlschema'] %}
from typed2django.django.models import Xml2DjangoBaseClass
{% else %}
# Fallback: import commonly used bases
from typed2django.django.models import Pydantic2DjangoBaseClass, Dataclass2DjangoBaseClass
{% endif %}

# Context types for optional context class generation
from pydantic2django.core.context import ModelContext, FieldContext

# Additional type imports from typing module
{% if extra_type_imports %}
from typing import {{ extra_type_imports|join(', ') }}
{% endif %}

# Django validators (conditionally included)
{% if validator_imports %}
{% for name in validator_imports %}
from django.core.validators import {{ name }}
{% endfor %}
{% endif %}

# Original Pydantic model imports
{% for import_line in pydantic_imports %}
{{ import_line }}
{% endfor %}

# Context class field type imports
{% for import_line in context_imports %}
{{ import_line }}
{% endfor %}

# Type variable for model classes
T = TypeVar('T')
