0001-misc-remove-jsonfield-requirement-53289.patch
chrono/agendas/migrations/0003_booking.py | ||
---|---|---|
1 | 1 |
# -*- coding: utf-8 -*- |
2 | 2 |
from __future__ import unicode_literals |
3 | 3 | |
4 |
import jsonfield.fields |
|
4 |
from django.contrib.postgres.fields import JSONField |
|
5 | 5 |
from django.db import migrations, models |
6 | 6 | |
7 | 7 | |
... | ... | |
19 | 19 |
'id', |
20 | 20 |
models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True), |
21 | 21 |
), |
22 |
('extra_data', jsonfield.fields.JSONField(null=True)),
|
|
22 |
('extra_data', JSONField(null=True)), |
|
23 | 23 |
('event', models.ForeignKey(to='agendas.Event', on_delete=models.CASCADE)), |
24 | 24 |
], |
25 | 25 |
options={}, |
chrono/agendas/migrations/0056_auto_20200811_1611.py | ||
---|---|---|
3 | 3 |
from __future__ import unicode_literals |
4 | 4 | |
5 | 5 |
import django.db.models.deletion |
6 |
import jsonfield.fields |
|
6 |
from django.contrib.postgres.fields import JSONField |
|
7 | 7 |
from django.db import migrations, models |
8 | 8 | |
9 | 9 | |
... | ... | |
23 | 23 |
), |
24 | 24 |
('timestamp', models.DateTimeField(auto_now_add=True)), |
25 | 25 |
('seen', models.BooleanField(default=False)), |
26 |
('booking_errors', jsonfield.fields.JSONField(default=dict)),
|
|
26 |
('booking_errors', JSONField(default=dict)), |
|
27 | 27 |
('bookings', models.ManyToManyField(to='agendas.Booking')), |
28 | 28 |
], |
29 | 29 |
options={ |
chrono/agendas/migrations/0075_auto_20210216_1553.py | ||
---|---|---|
3 | 3 |
from __future__ import unicode_literals |
4 | 4 | |
5 | 5 |
import django.db.models.deletion |
6 |
import jsonfield.fields |
|
6 |
from django.contrib.postgres.fields import JSONField |
|
7 | 7 |
from django.db import migrations, models |
8 | 8 | |
9 | 9 | |
... | ... | |
27 | 27 |
migrations.AddField( |
28 | 28 |
model_name='event', |
29 | 29 |
name='recurrence_rule', |
30 |
field=jsonfield.fields.JSONField(null=True, verbose_name='Recurrence rule'),
|
|
30 |
field=JSONField(null=True, verbose_name='Recurrence rule', blank=True),
|
|
31 | 31 |
), |
32 | 32 |
migrations.AddField( |
33 | 33 |
model_name='event', |
chrono/agendas/migrations/0079_text_to_jsonb.py | ||
---|---|---|
1 |
from combo.utils.db import EnsureJsonbType |
|
2 |
from django.db import migrations |
|
3 | ||
4 | ||
5 |
class Migration(migrations.Migration): |
|
6 | ||
7 |
dependencies = [ |
|
8 |
('agendas', '0078_absence_reasons'), |
|
9 |
] |
|
10 | ||
11 |
operations = [ |
|
12 |
EnsureJsonbType(model_name='booking', field_name='extra_data'), |
|
13 |
EnsureJsonbType(model_name='event', field_name='recurrence_rule'), |
|
14 |
EnsureJsonbType(model_name='eventcancellationreport', field_name='booking_errors'), |
|
15 |
] |
chrono/agendas/models.py | ||
---|---|---|
30 | 30 |
from dateutil.rrule import DAILY, WEEKLY, rrule, rruleset |
31 | 31 |
from django.conf import settings |
32 | 32 |
from django.contrib.auth.models import Group |
33 |
from django.contrib.postgres.fields import ArrayField |
|
33 |
from django.contrib.postgres.fields import ArrayField, JSONField
|
|
34 | 34 |
from django.core.exceptions import FieldDoesNotExist, ValidationError |
35 | 35 |
from django.core.validators import MaxValueValidator, MinValueValidator |
36 | 36 |
from django.db import connection, models, transaction |
... | ... | |
47 | 47 |
from django.utils.translation import ugettext |
48 | 48 |
from django.utils.translation import ugettext_lazy as _ |
49 | 49 |
from django.utils.translation import ungettext |
50 |
from jsonfield import JSONField |
|
51 | 50 | |
52 | 51 |
from chrono.interval import Interval, IntervalSet |
53 | 52 |
from chrono.utils.requests_wrapper import requests as requests_wrapper |
... | ... | |
1089 | 1088 |
agenda = models.ForeignKey(Agenda, on_delete=models.CASCADE) |
1090 | 1089 |
start_datetime = models.DateTimeField(_('Date/time')) |
1091 | 1090 |
repeat = models.CharField(_('Repeat'), max_length=16, blank=True, choices=REPEAT_CHOICES) |
1092 |
recurrence_rule = JSONField(_('Recurrence rule'), null=True) |
|
1091 |
recurrence_rule = JSONField(_('Recurrence rule'), null=True, blank=True)
|
|
1093 | 1092 |
recurrence_end_date = models.DateField(_('Recurrence end date'), null=True, blank=True) |
1094 | 1093 |
primary_event = models.ForeignKey('self', null=True, on_delete=models.CASCADE, related_name='recurrences') |
1095 | 1094 |
duration = models.PositiveIntegerField(_('Duration (in minutes)'), default=None, null=True, blank=True) |
... | ... | |
2251 | 2250 |
timestamp = models.DateTimeField(auto_now_add=True) |
2252 | 2251 |
seen = models.BooleanField(default=False) |
2253 | 2252 |
bookings = models.ManyToManyField(Booking) |
2254 |
booking_errors = JSONField() |
|
2253 |
booking_errors = JSONField(default=dict)
|
|
2255 | 2254 | |
2256 | 2255 |
def __str__(self): |
2257 | 2256 |
return '%s - %s' % (self.timestamp.strftime('%Y-%m-%d %H:%M:%S'), self.event) |
requirements.txt | ||
---|---|---|
1 | 1 |
django>=1.8, <1.9 |
2 | 2 |
gadjo |
3 | 3 |
djangorestframework>=3.1, <3.7 |
4 |
django-jsonfield >= 0.9.3 |
|
5 | 4 |
requests |
6 | 5 |
vobject |
setup.py | ||
---|---|---|
165 | 165 |
'gadjo', |
166 | 166 |
'djangorestframework>=3.4', |
167 | 167 |
'django-filter', |
168 |
'django-jsonfield >= 0.9.3', |
|
169 | 168 |
'vobject', |
170 | 169 |
'python-dateutil', |
171 | 170 |
'requests', |
172 |
- |