mirror of
https://github.com/django/django.git
synced 2025-08-03 18:38:50 +00:00
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:
parent
8058d9d7ad
commit
153c7956f8
5 changed files with 84 additions and 1 deletions
|
@ -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)
|
||||
|
||||
|
|
|
@ -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`
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue