PaperlessTask and consumption_tasks endpoint

This commit is contained in:
Michael Shamoon
2022-05-23 00:24:52 -07:00
parent a4927477fb
commit 5c980c31be
7 changed files with 180 additions and 0 deletions

View File

@@ -11,6 +11,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
@@ -500,3 +501,18 @@ class UiSettings(models.Model):
def __str__(self):
return self.user.username
class PaperlessTask(models.Model):
q_task_id = models.CharField(max_length=128)
name = models.CharField(max_length=256)
created = models.DateTimeField(_("created"), auto_now=True, db_index=True)
task = models.OneToOneField(
Task,
on_delete=models.CASCADE,
related_name="task",
null=True,
blank=True,
)
acknowledged = models.BooleanField(default=False)