From 081d94d7992f6081a79715794d3141a10ee05f71 Mon Sep 17 00:00:00 2001 From: Nick Sweeting Date: Fri, 11 Dec 2020 20:45:44 +0200 Subject: [PATCH] fallback to old JSONField from lib if django version is old --- archivebox/core/models.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/archivebox/core/models.py b/archivebox/core/models.py index dca6941f..d50e8f40 100644 --- a/archivebox/core/models.py +++ b/archivebox/core/models.py @@ -18,6 +18,12 @@ STATUS_CHOICES = [ ("skipped", "skipped") ] +try: + JSONField = models.JSONField +except AttributeError: + import jsonfield + JSONField = jsonfield.JSONField + class Tag(models.Model): """ @@ -173,7 +179,7 @@ class ArchiveResultManager(models.Manager): class ArchiveResult(models.Model): snapshot = models.ForeignKey(Snapshot, on_delete=models.CASCADE) - cmd = models.JSONField() + cmd = JSONField() pwd = models.CharField(max_length=256) cmd_version = models.CharField(max_length=32) output = models.CharField(max_length=512)