diff options
| author | Claude Paroz <claude@2xlibre.net> | 2016-08-11 21:05:52 +0200 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2016-08-25 21:42:42 +0200 |
| commit | 13c3e5d5a05e9c358d212d154addd703cac3bc66 (patch) | |
| tree | b718eb13592843cc6bfd1e6a56fabf23108bd191 /tests/postgres_tests/models.py | |
| parent | 989f6108d349e0eebdc5ad26b5cb4e882cb32e47 (diff) | |
Fixed #25995 -- Added an encoder option to JSONField
Thanks Berker Peksag and Tim Graham for the reviews.
Diffstat (limited to 'tests/postgres_tests/models.py')
| -rw-r--r-- | tests/postgres_tests/models.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/postgres_tests/models.py b/tests/postgres_tests/models.py index d94eb90d4a..52dbc0335c 100644 --- a/tests/postgres_tests/models.py +++ b/tests/postgres_tests/models.py @@ -1,3 +1,4 @@ +from django.core.serializers.json import DjangoJSONEncoder from django.db import connection, models from .fields import ( @@ -132,6 +133,7 @@ class RangeLookupsModel(PostgreSQLModel): if connection.vendor == 'postgresql' and connection.pg_version >= 90400: class JSONModel(models.Model): field = JSONField(blank=True, null=True) + field_custom = JSONField(blank=True, null=True, encoder=DjangoJSONEncoder) else: # create an object with this name so we don't have failing imports class JSONModel(object): |
