mirror of
https://github.com/ArchiveBox/ArchiveBox
synced 2024-11-10 06:34:16 +00:00
add proxy model for SinglefileResult wrapping ArchiveResult
This commit is contained in:
parent
04cb6bdfd6
commit
8d1d5df43a
3 changed files with 40 additions and 0 deletions
|
@ -0,0 +1,26 @@
|
|||
# Generated by Django 5.1.1 on 2024-09-10 05:05
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
('core', '0074_alter_snapshot_downloaded_at'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='SinglefileResult',
|
||||
fields=[
|
||||
],
|
||||
options={
|
||||
'proxy': True,
|
||||
'indexes': [],
|
||||
'constraints': [],
|
||||
},
|
||||
bases=('core.archiveresult',),
|
||||
),
|
||||
]
|
14
archivebox/builtin_plugins/singlefile/models.py
Normal file
14
archivebox/builtin_plugins/singlefile/models.py
Normal file
|
@ -0,0 +1,14 @@
|
|||
from django.db import models
|
||||
|
||||
from core.models import ArchiveResult
|
||||
|
||||
class SinglefileResultManager(models.Manager):
|
||||
def get_queryset(self):
|
||||
return super().get_queryset().filter(extractor='singlefile')
|
||||
|
||||
|
||||
class SinglefileResult(ArchiveResult):
|
||||
objects = SinglefileResultManager()
|
||||
|
||||
class Meta:
|
||||
proxy = True
|
Loading…
Reference in a new issue