mirror of
https://github.com/django/django.git
synced 2025-08-31 07:47:37 +00:00
Fixed #27582 -- Allowed HStoreField to store null values.
This commit is contained in:
parent
9524fd9133
commit
bf84d042e0
6 changed files with 33 additions and 9 deletions
|
@ -275,8 +275,9 @@ A more useful index is a ``GIN`` index, which you should create using a
|
|||
|
||||
.. class:: HStoreField(**options)
|
||||
|
||||
A field for storing mappings of strings to strings. The Python data type
|
||||
used is a ``dict``.
|
||||
A field for storing key-value pairs. The Python data type used is a
|
||||
``dict``. Keys must be strings, and values may be either strings or nulls
|
||||
(``None`` in Python).
|
||||
|
||||
To use this field, you'll need to:
|
||||
|
||||
|
@ -287,6 +288,10 @@ A more useful index is a ``GIN`` index, which you should create using a
|
|||
You'll see an error like ``can't adapt type 'dict'`` if you skip the first
|
||||
step, or ``type "hstore" does not exist`` if you skip the second.
|
||||
|
||||
.. versionchanged:: 1.11
|
||||
|
||||
Added the ability to store nulls. Previously, they were cast to strings.
|
||||
|
||||
.. note::
|
||||
|
||||
On occasions it may be useful to require or restrict the keys which are
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue