#33155: ModelChoiceIteratorValue is not hashable.
-------------------------------------+-------------------------------------
Reporter: Aljaž Košir | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Forms | Version: 3.1
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
ModelChoiceIteratorValue |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Aljaž Košir):
Replying to [comment:1 Mariusz Felisiak]:
> Thanks for the ticket. Agreed, we could make `ModelChoiceIteratorValue`
hashable by adding:
> {{{
> def __hash__(self):
> return hash(self.value)
> }}}
> For now you can use `value.value` as
[https://docs.djangoproject.com/en/3.2/releases/3.1/#id1 documented in the
"Backwards incompatible changes in 3.1" section]. Would you like to
prepare a patch?
Yes, sure.
--
Ticket URL: <https://code.djangoproject.com/ticket/33155#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/068.e318178a9bdf518c781911dfb0b82720%40djangoproject.com.