Merge pull request #4025 from AlanCoding/text_type

Change JSONField to be a DB text type
This commit is contained in:
Alan Rominger 2016-11-18 11:50:13 -05:00 committed by GitHub
commit a192077be4

View File

@ -32,6 +32,9 @@ __all__ = ['AutoOneToOneField', 'ImplicitRoleField', 'JSONField']
class JSONField(upstream_JSONField):
def db_type(self, connection):
return 'text'
def from_db_value(self, value, expression, connection, context):
if value in {'', None} and not self.null:
return {}