Fixed #24858 -- Added support for get_FOO_display() to ArrayField and RangeFields.

_get_FIELD_display() crashed when Field.choices was unhashable.
This commit is contained in:
Hasan Ramezani 2019-11-07 15:35:33 +01:00 committed by Mariusz Felisiak
parent 8058d9d7ad
commit 153c7956f8
5 changed files with 84 additions and 1 deletions

View file

@ -797,6 +797,11 @@ For example::
>>> p.get_shirt_size_display()
'Large'
.. versionchanged:: 3.1
Support for :class:`~django.contrib.postgres.fields.ArrayField` and
:class:`~django.contrib.postgres.fields.RangeField` was added.
.. method:: Model.get_next_by_FOO(**kwargs)
.. method:: Model.get_previous_by_FOO(**kwargs)

View file

@ -76,6 +76,10 @@ Minor features
:class:`~django.contrib.postgres.operations.BloomExtension` migration
operation installs the ``bloom`` extension to add support for this index.
* :meth:`~django.db.models.Model.get_FOO_display` now supports
:class:`~django.contrib.postgres.fields.ArrayField` and
:class:`~django.contrib.postgres.fields.RangeField`.
:mod:`django.contrib.redirects`
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~