Skip to content

Commit b21ef56

Browse files
committed
attempt to fix import problem on missing dependencies
1 parent 518bf61 commit b21ef56

File tree

1 file changed

+21
-9
lines changed

1 file changed

+21
-9
lines changed

django_enum/choices.py

+21-9
Original file line numberDiff line numberDiff line change
@@ -90,25 +90,37 @@ def __init__(self, *args, **kwargs): # pylint: disable=W0231
9090
)
9191

9292
class TextChoices( # type: ignore
93-
DjangoSymmetricMixin,
93+
#DjangoSymmetricMixin,
9494
str,
95-
Choices,
96-
metaclass=ChoicesMeta
95+
Choices
9796
):
9897
"""Raises ImportError on class definition"""
98+
def __new__(mcs, *args, **kwargs):
99+
raise ImportError(
100+
f'{mcs.__name__} requires enum-properties to be '
101+
f'installed.'
102+
)
99103

100104
class IntegerChoices( # type: ignore
101-
DjangoSymmetricMixin,
105+
#DjangoSymmetricMixin,
102106
int,
103-
Choices,
104-
metaclass=ChoicesMeta
107+
Choices
105108
):
106109
"""Raises ImportError on class definition"""
110+
def __new__(mcs, *args, **kwargs):
111+
raise ImportError(
112+
f'{mcs.__name__} requires enum-properties to be '
113+
f'installed.'
114+
)
107115

108116
class FloatChoices( # type: ignore
109-
DjangoSymmetricMixin,
117+
#DjangoSymmetricMixin,
110118
float,
111-
Choices,
112-
metaclass=ChoicesMeta
119+
Choices
113120
):
114121
"""Raises ImportError on class definition"""
122+
def __new__(mcs, *args, **kwargs):
123+
raise ImportError(
124+
f'{mcs.__name__} requires enum-properties to be '
125+
f'installed.'
126+
)

0 commit comments

Comments
 (0)