general: switch to django postgresql json field (#64294)
This commit is contained in:
parent
669c6c769b
commit
8083554ab8
|
@ -1,6 +1,8 @@
|
|||
import jsonfield.fields
|
||||
from django.contrib.postgres.fields import JSONField
|
||||
from django.db import migrations, models
|
||||
|
||||
import bijoe.visualization.models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
|
@ -15,7 +17,14 @@ class Migration(migrations.Migration):
|
|||
models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True),
|
||||
),
|
||||
('name', models.TextField(verbose_name='name')),
|
||||
('parameters', jsonfield.fields.JSONField(default=dict, verbose_name='parameters')),
|
||||
(
|
||||
'parameters',
|
||||
JSONField(
|
||||
default=dict,
|
||||
verbose_name='parameters',
|
||||
encoder=bijoe.visualization.models.JSONEncoder,
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
'ordering': ('name', 'id'),
|
||||
|
|
|
@ -17,11 +17,11 @@
|
|||
import datetime
|
||||
import json
|
||||
|
||||
from django.contrib.postgres.fields import JSONField
|
||||
from django.db import models
|
||||
from django.http import Http404
|
||||
from django.utils.text import slugify
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from jsonfield import JSONField
|
||||
|
||||
from bijoe.utils import get_warehouses
|
||||
|
||||
|
@ -41,7 +41,7 @@ class JSONEncoder(json.JSONEncoder):
|
|||
class Visualization(models.Model):
|
||||
slug = models.SlugField(verbose_name=_('Identifier'), unique=True, max_length=200)
|
||||
name = models.TextField(verbose_name=_('name'))
|
||||
parameters = JSONField(verbose_name=_('parameters'), encoder_class=JSONEncoder)
|
||||
parameters = JSONField(verbose_name=_('parameters'), default=dict, encoder=JSONEncoder)
|
||||
|
||||
class Meta:
|
||||
ordering = ('name', 'id')
|
||||
|
|
|
@ -10,7 +10,6 @@ Package: python3-bijoe
|
|||
Architecture: all
|
||||
Depends: ${python3:Depends},
|
||||
${misc:Depends},
|
||||
python3-django-jsonfield (>= 0.9.19),
|
||||
python3-hobo,
|
||||
python3-django-select2,
|
||||
python3-django-tenant-schemas,
|
||||
|
|
Loading…
Reference in New Issue