A simple question: setting a field as ArrayField (JSONField (...), ...) using Django 1.9+ and PostgreSQL 9.4.6 does not work when saving
class Foo(models.Model):
bar = ArrayField(JSONField(blank=True, null=True), default=list([]))
...
data = request.data
Foo(bar=data)
django.db.utils.ProgrammingError: column "bar" is of type \
jsonb[] but expression is of type text[]
LINE 1: INSERT INTO "app_foo" ("bar") VALUES (ARRAY['{"name": ...
^
HINT: You will need to rewrite or cast the expression.
source
share