mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #26748 -- Allowed overriding JSONField's widget with an attribute.
This commit is contained in:
committed by
Tim Graham
parent
57eb17b8c7
commit
f2c0eb19e9
@@ -15,10 +15,7 @@ class JSONField(forms.CharField):
|
||||
default_error_messages = {
|
||||
'invalid': _("'%(value)s' value must be valid JSON."),
|
||||
}
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
kwargs.setdefault('widget', forms.Textarea)
|
||||
super(JSONField, self).__init__(**kwargs)
|
||||
widget = forms.Textarea
|
||||
|
||||
def to_python(self, value):
|
||||
if value in self.empty_values:
|
||||
|
||||
Reference in New Issue
Block a user