mirror of
https://github.com/django/django.git
synced 2025-08-17 09:10:39 +00:00
[1.8.x] Fixed #24690 -- Added a warning about mutable defaults for ArrayField.
Backport of f93e7f5674
from master
This commit is contained in:
parent
b46dad1bef
commit
ef5cf564bf
1 changed files with 6 additions and 0 deletions
|
@ -17,6 +17,12 @@ ArrayField
|
|||
<ArrayField.size>`. ``ArrayField`` can be nested to store multi-dimensional
|
||||
arrays.
|
||||
|
||||
If you give the field a :attr:`~django.db.models.Field.default`, ensure
|
||||
it's a callable such as ``list`` (for an empty default) or a callable that
|
||||
returns a list (such as a function). Incorrectly using ``default=[]``
|
||||
creates a mutable default that is shared between all instances of
|
||||
``ArrayField``.
|
||||
|
||||
.. attribute:: base_field
|
||||
|
||||
This is a required argument.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue