Skip to content

Commit 9740b9c

Browse files
committed
fixes #35
1 parent 36afe1a commit 9740b9c

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

django_enum/choices.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,9 @@ class TextChoices(
114114
accepts enum-properties property lists.
115115
"""
116116

117+
def __hash__(self):
118+
return DjangoTextChoices.__hash__(self)
119+
117120

118121
class IntegerChoices(
119122
DjangoSymmetricMixin,
@@ -125,6 +128,9 @@ class IntegerChoices(
125128
accepts enum-properties property lists.
126129
"""
127130

131+
def __hash__(self):
132+
return DjangoIntegerChoices.__hash__(self)
133+
128134

129135
class FloatChoices(
130136
DjangoSymmetricMixin,
@@ -137,6 +143,10 @@ class FloatChoices(
137143
property lists.
138144
"""
139145

146+
def __hash__(self):
147+
return float.__hash__(self)
148+
149+
140150
except (ImportError, ModuleNotFoundError):
141151

142152
# 3.11 - extend from Enum so base type check does not throw type error

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ exclude = ["django_enum/tests"]
4242
[tool.poetry.dependencies]
4343
python = ">=3.7,<4.0"
4444
Django = ">=3.2,<5.0"
45-
enum-properties = {version = "^1.2.0", optional = true}
45+
enum-properties = {version = "^1.7.0", optional = true}
4646
django-filter = {version = ">=21,<24", optional = true}
4747
djangorestframework = {version = "^3.9", optional = true}
4848

0 commit comments

Comments
 (0)