#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 -------------------------------------+------------------------------------- Changes (by Mariusz Felisiak):
* type: Bug => Cleanup/optimization * easy: 0 => 1 * stage: Unreviewed => Accepted Comment: 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]. -- Ticket URL: <https://code.djangoproject.com/ticket/33155#comment:1> 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 django-updates+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/068.db7e3ad5aebabbf5191e1a60a9ba34df%40djangoproject.com.