21 lines
707 B
Diff
21 lines
707 B
Diff
# django__django-14915
|
|
# Loki Mode Multi-Agent Patch
|
|
# Attempts: 1
|
|
|
|
Based on the architect's analysis, I have enough information to generate the patch. The `ModelChoiceIteratorValue` class needs a `__hash__` method that returns `hash(self.value)`. This is a standard fix for making a class hashable when it already has an `__eq__` method.
|
|
|
|
```
|
|
--- a/django/forms/models.py
|
|
+++ b/django/forms/models.py
|
|
@@ -1162,6 +1162,9 @@ class ModelChoiceIteratorValue:
|
|
def __eq__(self, other):
|
|
if isinstance(other, ModelChoiceIteratorValue):
|
|
other = other.value
|
|
return self.value == other
|
|
+
|
|
+ def __hash__(self):
|
|
+ return hash(self.value)
|
|
|
|
|
|
class ModelChoiceIterator:
|
|
```
|