Changes between Initial Version and Version 2 of Ticket #36930
- Timestamp:
- Feb 15, 2026, 5:46:33 AM (3 hours ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #36930
- Property Owner set to
- Property Status new → assigned
-
Ticket #36930 – Description
initial v2 20 20 When using such definitions, the default value is not selected by default in forms created for such model. This is bescause the `str()` of the default value returns the string representation provided by `enum.Enum` instead of the string representation from `float`. 21 21 22 I believe this is a regression in https://github.com/ antoinehumbert/django/commit/fe19b33e2f76045617067dd5123041ae4d3a91ee where the `django.db.models.Choices.__str__` (which specifically called `str(self.value)`) method was removed to the profit of making `IntegerChoices` and `TextChoices` inherit from `enum.ReprEnum`). Unfortunaltly, this dropped the initial `Choices.__str__` behaviour for all other subclasses of `Choices`.22 I believe this is a regression in https://github.com/django/django/commit/fe19b33e2f76045617067dd5123041ae4d3a91ee where the `django.db.models.Choices.__str__` (which specifically called `str(self.value)`) method was removed to the profit of making `IntegerChoices` and `TextChoices` inherit from `enum.ReprEnum`). Unfortunaltly, this dropped the initial `Choices.__str__` behaviour for all other subclasses of `Choices`. 23 23 24 24 I think the fix is as simple as making `Choices` inherit from `enum.ReprEnum` instead of `enum.Enum`.