1
0
Fork 0
mirror of synced 2024-06-24 00:50:23 +12:00

fix: Update model according to code review

This commit is contained in:
Cristian 2020-11-23 18:28:43 -05:00
parent 0f13087a09
commit 34a1a6d30d
3 changed files with 18 additions and 13 deletions

View file

@ -76,14 +76,14 @@ class Migration(migrations.Migration):
name='ArchiveResult',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('cmd', models.CharField(default='', max_length=500)),
('pwd', models.CharField(default='', max_length=200)),
('cmd_version', models.CharField(default='', max_length=20)),
('status', models.CharField(max_length=10)),
('output', models.CharField(default='', max_length=500)),
('cmd', models.CharField(max_length=500)),
('pwd', models.CharField(max_length=200)),
('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)),
('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=20)),
('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)),
('snapshot', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Snapshot')),
],
),

View file

@ -11,6 +11,11 @@ from ..index.schema import Link
from ..extractors import get_default_archive_methods
EXTRACTORS = [(extractor[0], extractor[0]) for extractor in get_default_archive_methods()]
STATUS_CHOICES = [
("succeeded", "succeeded"),
("failed", "failed"),
("skipped", "skipped")
]
class Tag(models.Model):
@ -155,14 +160,14 @@ class Snapshot(models.Model):
class ArchiveResult(models.Model):
snapshot = models.ForeignKey(Snapshot, on_delete=models.CASCADE)
cmd = models.CharField(max_length=500, default="")
pwd = models.CharField(max_length=200, default="")
cmd_version = models.CharField(max_length=20, default="")
output = models.CharField(max_length=500, default="")
cmd = models.CharField(max_length=500)
pwd = models.CharField(max_length=200)
cmd_version = models.CharField(max_length=32)
output = models.CharField(max_length=500)
start_ts = models.DateTimeField()
end_ts = models.DateTimeField()
status = models.CharField(max_length=10)
extractor = models.CharField(choices=EXTRACTORS, blank=False, max_length=20)
status = models.CharField(max_length=16, choices=STATUS_CHOICES)
extractor = models.CharField(choices=EXTRACTORS, blank=False, max_length=32)
def __str__(self):
return self.extractor

View file

@ -225,7 +225,7 @@
}
.exists-False {
display: none;
opacity: 0.1;
}
</style>
<link rel="stylesheet" href="{% static 'bootstrap.min.css' %}">