0005-general-switch-to-django-postgresql-json-field-64294.patch
bijoe/visualization/migrations/0001_initial.py | ||
---|---|---|
1 |
import jsonfield.fields |
|
1 |
from django.contrib.postgres.fields import JSONField |
|
2 | 2 |
from django.db import migrations, models |
3 | 3 | |
4 |
import bijoe.visualization.models |
|
5 | ||
4 | 6 | |
5 | 7 |
class Migration(migrations.Migration): |
6 | 8 | |
... | ... | |
15 | 17 |
models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True), |
16 | 18 |
), |
17 | 19 |
('name', models.TextField(verbose_name='name')), |
18 |
('parameters', jsonfield.fields.JSONField(default=dict, verbose_name='parameters')), |
|
20 |
( |
|
21 |
'parameters', |
|
22 |
JSONField( |
|
23 |
default=dict, |
|
24 |
verbose_name='parameters', |
|
25 |
encoder=bijoe.visualization.models.JSONEncoder, |
|
26 |
), |
|
27 |
), |
|
19 | 28 |
], |
20 | 29 |
options={ |
21 | 30 |
'ordering': ('name', 'id'), |
bijoe/visualization/models.py | ||
---|---|---|
17 | 17 |
import datetime |
18 | 18 |
import json |
19 | 19 | |
20 |
from django.contrib.postgres.fields import JSONField |
|
20 | 21 |
from django.db import models |
21 | 22 |
from django.http import Http404 |
22 | 23 |
from django.utils.text import slugify |
23 | 24 |
from django.utils.translation import ugettext_lazy as _ |
24 |
from jsonfield import JSONField |
|
25 | 25 | |
26 | 26 |
from bijoe.utils import get_warehouses |
27 | 27 | |
... | ... | |
41 | 41 |
class Visualization(models.Model): |
42 | 42 |
slug = models.SlugField(verbose_name=_('Identifier'), unique=True, max_length=200) |
43 | 43 |
name = models.TextField(verbose_name=_('name')) |
44 |
parameters = JSONField(verbose_name=_('parameters'), encoder_class=JSONEncoder)
|
|
44 |
parameters = JSONField(verbose_name=_('parameters'), default=dict, encoder=JSONEncoder)
|
|
45 | 45 | |
46 | 46 |
class Meta: |
47 | 47 |
ordering = ('name', 'id') |
debian/control | ||
---|---|---|
10 | 10 |
Architecture: all |
11 | 11 |
Depends: ${python3:Depends}, |
12 | 12 |
${misc:Depends}, |
13 |
python3-django-jsonfield (>= 0.9.19), |
|
14 | 13 |
python3-hobo, |
15 | 14 |
python3-django-select2, |
16 | 15 |
python3-django-tenant-schemas, |
setup.py | ||
---|---|---|
100 | 100 |
'Django-Select2<6', |
101 | 101 |
'XStatic-ChartNew.js', |
102 | 102 |
'gadjo', |
103 |
'django-jsonfield<1.3', |
|
104 | 103 |
'python-dateutil', |
105 | 104 |
'djangorestframework', |
106 | 105 |
'xstatic-select2', |
107 |
- |