﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
29388	JSONField defaults to empty list gets modified	Ponytech		"Consider this simple model :


{{{
from django.db import models
from django.contrib.postgres.fields import JSONField


class Thing(models.Model):
	name = models.CharField(max_length=100)
	features = JSONField(default=[], blank=True)
}}}


And this code snippet : 

{{{
>>> t1 = Thing.objects.create(name=""thing 1"")
>>> t1.features.append({""f1"": 42, ""f2"": 56})
>>> t1.features
[{'f1': 42, 'f2': 56}]
>>> t1.save()
>>> t2 = Thing.objects.create(name=""thing 2"")
>>> t2.features
[{'f1': 42, 'f2': 56}]
}}}

I'd expect t2 features to be an empty list. 

My guess is the model default fields gets modified somehow."	Bug	closed	contrib.postgres	2.0	Normal	invalid			Unreviewed	0	0	0	0	0	0
