Files
app-store-optimization/skills/loki-mode/benchmarks/results/2026-01-05-10-37-54/swebench-loki-patches/django__django-14915.patch

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:
```