mirror of
https://github.com/ArchiveBox/ArchiveBox
synced 2024-11-10 06:34:16 +00:00
feat: Initial (and naive) ArchiveResult model
This commit is contained in:
parent
4bdda4d753
commit
8f3c03a0f9
2 changed files with 37 additions and 0 deletions
27
archivebox/core/migrations/0007_archiveresult.py
Normal file
27
archivebox/core/migrations/0007_archiveresult.py
Normal file
|
@ -0,0 +1,27 @@
|
|||
# Generated by Django 3.0.8 on 2020-11-03 14:52
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('core', '0006_auto_20201012_1520'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
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)),
|
||||
('output', models.CharField(default='', max_length=500)),
|
||||
('start_ts', models.DateTimeField()),
|
||||
('end_ts', models.DateTimeField()),
|
||||
('snapshot', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Snapshot')),
|
||||
],
|
||||
),
|
||||
]
|
|
@ -148,3 +148,13 @@ class Snapshot(models.Model):
|
|||
tags_id.append(Tag.objects.get_or_create(name=tag)[0].id)
|
||||
self.tags.clear()
|
||||
self.tags.add(*tags_id)
|
||||
|
||||
|
||||
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="")
|
||||
start_ts = models.DateTimeField()
|
||||
end_ts = models.DateTimeField()
|
Loading…
Reference in a new issue