mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2026-04-05 23:37:58 +10:00
feat: Add extractor field to the database
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
# Generated by Django 3.0.8 on 2020-11-03 14:52
|
# Generated by Django 3.0.8 on 2020-11-04 12:25
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
import django.db.models.deletion
|
import django.db.models.deletion
|
||||||
@@ -21,6 +21,7 @@ class Migration(migrations.Migration):
|
|||||||
('output', models.CharField(default='', max_length=500)),
|
('output', models.CharField(default='', max_length=500)),
|
||||||
('start_ts', models.DateTimeField()),
|
('start_ts', models.DateTimeField()),
|
||||||
('end_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)),
|
||||||
('snapshot', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Snapshot')),
|
('snapshot', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Snapshot')),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -8,6 +8,9 @@ from django.utils.text import slugify
|
|||||||
|
|
||||||
from ..util import parse_date
|
from ..util import parse_date
|
||||||
from ..index.schema import Link
|
from ..index.schema import Link
|
||||||
|
from ..extractors import get_default_archive_methods
|
||||||
|
|
||||||
|
EXTRACTORS = [(extractor[0], extractor[0]) for extractor in get_default_archive_methods()]
|
||||||
|
|
||||||
|
|
||||||
class Tag(models.Model):
|
class Tag(models.Model):
|
||||||
@@ -158,3 +161,4 @@ class ArchiveResult(models.Model):
|
|||||||
output = models.CharField(max_length=500, default="")
|
output = models.CharField(max_length=500, default="")
|
||||||
start_ts = models.DateTimeField()
|
start_ts = models.DateTimeField()
|
||||||
end_ts = models.DateTimeField()
|
end_ts = models.DateTimeField()
|
||||||
|
extractor = models.CharField(choices=EXTRACTORS, blank=False, max_length=20)
|
||||||
Reference in New Issue
Block a user