Merge pull request #1020 from paperless-ngx/feature-frontend-task-queue

Feature: frontend task queue
This commit is contained in:
shamoon
2022-07-08 14:06:24 -07:00
committed by GitHub
19 changed files with 722 additions and 4 deletions

View File

@@ -12,6 +12,7 @@ from django.contrib.auth.models import User
from django.db import models
from django.utils import timezone
from django.utils.translation import gettext_lazy as _
from django_q.tasks import Task
from documents.parsers import get_default_file_extension
@@ -510,3 +511,19 @@ class UiSettings(models.Model):
def __str__(self):
return self.user.username
class PaperlessTask(models.Model):
task_id = models.CharField(max_length=128)
name = models.CharField(max_length=256)
created = models.DateTimeField(_("created"), auto_now=True)
started = models.DateTimeField(_("started"), null=True)
attempted_task = models.OneToOneField(
Task,
on_delete=models.CASCADE,
related_name="attempted_task",
null=True,
blank=True,
)
acknowledged = models.BooleanField(default=False)