diff options
| author | Aljaž Košir <aljazkosir5@gmail.com> | 2021-09-30 12:07:50 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-09-30 12:07:50 +0200 |
| commit | 7b8beeee3d45cafd7bec7ff3ee0e4371e142c36d (patch) | |
| tree | 212052c4eaebda9ed22e3587a98b292af8e74d55 /django/forms | |
| parent | 903aaa35e5ceaa33bfc9b19b7f6da65ce5a91dd4 (diff) | |
Fixed #33155 -- Made ModelChoiceIteratorValue instances hashable.
Diffstat (limited to 'django/forms')
| -rw-r--r-- | django/forms/models.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/django/forms/models.py b/django/forms/models.py index 5dcf923c12..7effb202e3 100644 --- a/django/forms/models.py +++ b/django/forms/models.py @@ -1166,6 +1166,9 @@ class ModelChoiceIteratorValue: def __str__(self): return str(self.value) + def __hash__(self): + return hash(self.value) + def __eq__(self, other): if isinstance(other, ModelChoiceIteratorValue): other = other.value |
