diff --git a/eav/models/attribute.py b/eav/models/attribute.py index 61dc8a7..4aefd19 100644 --- a/eav/models/attribute.py +++ b/eav/models/attribute.py @@ -1,7 +1,7 @@ from __future__ import annotations import warnings -from typing import TYPE_CHECKING, Optional +from typing import TYPE_CHECKING from django.contrib.contenttypes.models import ContentType from django.core.exceptions import ValidationError @@ -163,7 +163,7 @@ class Attribute(models.Model): :meth:`~eav.registry.EavConfig.get_attributes` method of that entity's config. """ - enum_group: ForeignKey[Optional[EnumGroup]] = ForeignKey( + enum_group: ForeignKey[EnumGroup | None] = ForeignKey( "eav.EnumGroup", on_delete=models.PROTECT, blank=True, diff --git a/eav/models/value.py b/eav/models/value.py index 8d2500a..2b4d234 100644 --- a/eav/models/value.py +++ b/eav/models/value.py @@ -1,6 +1,6 @@ from __future__ import annotations -from typing import TYPE_CHECKING, ClassVar, Optional +from typing import TYPE_CHECKING, ClassVar from django.contrib.contenttypes import fields as generic from django.contrib.contenttypes.models import ContentType @@ -136,7 +136,7 @@ class Value(models.Model): verbose_name=_("Value JSON"), ) - value_enum: ForeignKey[Optional[EnumValue]] = ForeignKey( + value_enum: ForeignKey[EnumValue | None] = ForeignKey( "eav.EnumValue", blank=True, null=True,