1
0
Fork 0

feat: Bump django, update migration and change cmd to use JSONField

This commit is contained in:
Cristian 2020-11-27 16:23:27 -05:00
parent f61e6a74bb
commit 4b3f72202b
5 changed files with 8 additions and 8 deletions

View file

@ -57,6 +57,7 @@ archivebox/core/migrations/0003_auto_20200630_1034.py
archivebox/core/migrations/0004_auto_20200713_1552.py
archivebox/core/migrations/0005_auto_20200728_0326.py
archivebox/core/migrations/0006_auto_20201012_1520.py
archivebox/core/migrations/0007_archiveresult.py
archivebox/core/migrations/__init__.py
archivebox/extractors/__init__.py
archivebox/extractors/archive_org.py

View file

@ -2,7 +2,7 @@ requests==2.24.0
atomicwrites==1.4.0
mypy-extensions==0.4.3
base32-crockford==0.3.0
django==3.0.8
django==3.1.3
django-extensions==3.0.3
dateparser
ipython
@ -13,7 +13,6 @@ w3lib==1.22.0
[dev]
setuptools
wheel
twine
flake8
ipdb

View file

@ -30,7 +30,7 @@ def forwards_func(apps, schema_editor):
for extractor in history:
for result in history[extractor]:
ArchiveResult.objects.create(extractor=extractor, snapshot=snapshot, cmd=json.dumps(result["cmd"]), cmd_version=result["cmd_version"],
ArchiveResult.objects.create(extractor=extractor, snapshot=snapshot, cmd=result["cmd"], cmd_version=result["cmd_version"],
start_ts=result["start_ts"], end_ts=result["end_ts"], status=result["status"], pwd=result["pwd"], output=result["output"])
@ -76,11 +76,11 @@ class Migration(migrations.Migration):
name='ArchiveResult',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('cmd', models.CharField(max_length=500)),
('pwd', models.CharField(max_length=200)),
('cmd', models.JSONField()),
('pwd', models.CharField(max_length=256)),
('cmd_version', models.CharField(max_length=32)),
('status', models.CharField(choices=[('succeeded', 'succeeded'), ('failed', 'failed'), ('skipped', 'skipped')], max_length=16)),
('output', models.CharField(max_length=500)),
('output', models.CharField(max_length=512)),
('start_ts', models.DateTimeField()),
('end_ts', models.DateTimeField()),
('extractor', models.CharField(choices=[('title', 'title'), ('favicon', 'favicon'), ('wget', 'wget'), ('singlefile', 'singlefile'), ('pdf', 'pdf'), ('screenshot', 'screenshot'), ('dom', 'dom'), ('readability', 'readability'), ('mercury', 'mercury'), ('git', 'git'), ('media', 'media'), ('headers', 'headers'), ('archive_org', 'archive_org')], max_length=32)),

View file

@ -160,7 +160,7 @@ class Snapshot(models.Model):
class ArchiveResult(models.Model):
snapshot = models.ForeignKey(Snapshot, on_delete=models.CASCADE)
cmd = models.CharField(max_length=500)
cmd = models.JSONField()
pwd = models.CharField(max_length=256)
cmd_version = models.CharField(max_length=32)
output = models.CharField(max_length=512)

View file

@ -52,7 +52,7 @@ setuptools.setup(
"atomicwrites==1.4.0",
"mypy-extensions==0.4.3",
"base32-crockford==0.3.0",
"django==3.0.8",
"django==3.1.3",
"django-extensions==3.0.3",
"dateparser",