Skip to content

Commit b7bfd08

Browse files
committed
Fixed incompatibility with django-1.9
1 parent 09f8eab commit b7bfd08

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

jsoneditor/forms.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
from django.forms.widgets import Textarea
2-
from django.forms.util import flatatt
2+
try:
3+
from django.forms.util import flatatt
4+
except ImportError:
5+
from django.forms.utils import flatatt
36

47
from django.utils.safestring import mark_safe
58

testapp/migrations/0001_initial.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
from django.db import models, migrations
55
import jsoneditor.fields.django_jsonfield
6-
import jsoneditor.fields.django_json_field
6+
#import jsoneditor.fields.django_json_field
77

88

99
class Migration(migrations.Migration):
@@ -16,23 +16,23 @@ class Migration(migrations.Migration):
1616
name='TestModel',
1717
fields=[
1818
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
19-
('test_django_json_field', jsoneditor.fields.django_json_field.JSONField(default='null', help_text=b'Test JSON editor for the django-json-field from https://github.com/derek-schaefer/django-json-field', null=True, verbose_name=b'Test JSON 1', blank=True)),
19+
# ('test_django_json_field', jsoneditor.fields.django_json_field.JSONField(default='null', help_text=b'Test JSON editor for the django-json-field from https://github.com/derek-schaefer/django-json-field', null=True, verbose_name=b'Test JSON 1', blank=True)),
2020
('test_django_jsonfield', jsoneditor.fields.django_jsonfield.JSONField(help_text=b'Test JSON editor for the django-jsonfield from https://github.com/bradjasper/django-jsonfield', null=True, verbose_name=b'Test JSON 2', blank=True)),
2121
],
2222
),
2323
migrations.CreateModel(
2424
name='TestSubModel1',
2525
fields=[
2626
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
27-
('test_inline_json_field', jsoneditor.fields.django_json_field.JSONField(default='null', help_text=b'Test JSON editor for the django-json-field from https://github.com/derek-schaefer/django-json-field', null=True, verbose_name=b'Test JSON 1', blank=True)),
27+
('test_inline_json_field', jsoneditor.fields.django_jsonfield.JSONField(default='null', help_text=b'Test JSON editor for the django-json-field from https://github.com/derek-schaefer/django-json-field', null=True, verbose_name=b'Test JSON 1', blank=True)),
2828
('par', models.ForeignKey(to='testapp.TestModel')),
2929
],
3030
),
3131
migrations.CreateModel(
3232
name='TestSubModel2',
3333
fields=[
3434
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
35-
('test_inline_json_field', jsoneditor.fields.django_json_field.JSONField(default='null', help_text=b'Test JSON editor for the django-json-field from https://github.com/derek-schaefer/django-json-field', null=True, verbose_name=b'Test JSON 1', blank=True)),
35+
('test_inline_json_field', jsoneditor.fields.django_jsonfield.JSONField(default='null', help_text=b'Test JSON editor for the django-json-field from https://github.com/derek-schaefer/django-json-field', null=True, verbose_name=b'Test JSON 1', blank=True)),
3636
('par', models.ForeignKey(to='testapp.TestModel')),
3737
],
3838
),

testapp/models.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
from django.db import models
22

3-
from jsoneditor.fields.django_json_field import JSONField as JSONField1
3+
#from jsoneditor.fields.django_json_field import JSONField as JSONField1
44
from jsoneditor.fields.django_jsonfield import JSONField as JSONField2
55
# Create your models here.
66

77
class TestModel(models.Model):
8-
test_django_json_field = JSONField1(verbose_name="Test JSON 1",null=True,blank=True,help_text="Test JSON editor for the django-json-field from https://github.com/derek-schaefer/django-json-field")
8+
# test_django_json_field = JSONField1(verbose_name="Test JSON 1",null=True,blank=True,help_text="Test JSON editor for the django-json-field from https://github.com/derek-schaefer/django-json-field")
99
test_django_jsonfield = JSONField2(verbose_name="Test JSON 2",null=True,blank=True,help_text="Test JSON editor for the django-jsonfield from https://github.com/bradjasper/django-jsonfield")
1010

1111
class TestSubModel1(models.Model):
1212
par = models.ForeignKey(TestModel)
13-
test_inline_json_field = JSONField1(verbose_name="Test JSON 1",null=True,blank=True,help_text="Test JSON editor for the django-json-field from https://github.com/derek-schaefer/django-json-field")
13+
test_inline_json_field = JSONField2(verbose_name="Test JSON 2",null=True,blank=True,help_text="Test JSON editor for the django-jsonfield from https://github.com/bradjasper/django-jsonfield")
1414

1515
class TestSubModel2(models.Model):
1616
par = models.ForeignKey(TestModel)
17-
test_inline_json_field = JSONField1(verbose_name="Test JSON 1",null=True,blank=True,help_text="Test JSON editor for the django-json-field from https://github.com/derek-schaefer/django-json-field")
17+
test_inline_json_field = JSONField2(verbose_name="Test JSON 2",null=True,blank=True,help_text="Test JSON editor for the django-jsonfield from https://github.com/bradjasper/django-jsonfield")

0 commit comments

Comments
 (0)