From: Radek Czajka Date: Tue, 19 Nov 2013 08:26:28 +0000 (+0100) Subject: Upgrade JSONField. X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/3050ec49d5392fe0120fad4ef02ada55d8b7d04e?ds=sidebyside;hp=--cc Upgrade JSONField. --- 3050ec49d5392fe0120fad4ef02ada55d8b7d04e diff --git a/apps/catalogue/models/book.py b/apps/catalogue/models/book.py index d69cf2aca..02051fb29 100644 --- a/apps/catalogue/models/book.py +++ b/apps/catalogue/models/book.py @@ -36,7 +36,7 @@ class Book(models.Model): created_at = models.DateTimeField(_('creation date'), auto_now_add=True, db_index=True) changed_at = models.DateTimeField(_('creation date'), auto_now=True, db_index=True) parent_number = models.IntegerField(_('parent number'), default=0) - extra_info = jsonfield.JSONField(_('extra information'), default='{}') + extra_info = jsonfield.JSONField(_('extra information'), default={}) gazeta_link = models.CharField(blank=True, max_length=240) wiki_link = models.CharField(blank=True, max_length=240) # files generated during publication diff --git a/apps/catalogue/models/bookmedia.py b/apps/catalogue/models/bookmedia.py index 88f60f16a..186bb405c 100644 --- a/apps/catalogue/models/bookmedia.py +++ b/apps/catalogue/models/bookmedia.py @@ -27,7 +27,7 @@ class BookMedia(models.Model): name = models.CharField(_('name'), max_length="100") file = OverwritingFileField(_('file'), upload_to=book_upload_path()) uploaded_at = models.DateTimeField(_('creation date'), auto_now_add=True, editable=False, db_index=True) - extra_info = jsonfield.JSONField(_('extra information'), default='{}', editable=False) + extra_info = jsonfield.JSONField(_('extra information'), default={}, editable=False) book = models.ForeignKey('Book', related_name='media') source_sha1 = models.CharField(null=True, blank=True, max_length=40, editable=False) diff --git a/apps/sponsors/models.py b/apps/sponsors/models.py index 2d18d1664..cbc8d9ba4 100644 --- a/apps/sponsors/models.py +++ b/apps/sponsors/models.py @@ -35,7 +35,7 @@ class Sponsor(models.Model): class SponsorPage(models.Model): name = models.CharField(_('name'), max_length=120) - sponsors = JSONField(_('sponsors'), default='{}') + sponsors = JSONField(_('sponsors'), default={}) _html = models.TextField(blank=True, editable=False) sprite = models.ImageField(upload_to='sponsorzy/sprite', blank=True) diff --git a/requirements.txt b/requirements.txt index d6355f2cc..cd319e24e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,7 +9,7 @@ django-pipeline>=1.2.24,<1.3 django-pagination>=1.0 django-maintenancemode>=0.10 django-piston>=0.2.2.1,<0.2.3 --e git+git://github.com/bradjasper/django-jsonfield.git@e67ec8c3652e61d8b47cc8db012a63f5ad39323d#egg=django-jsonfield +jsonfield>=0.9.20 django-picklefield #django-allauth<0.10 with migration fix