mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-08-14 00:26:21 +00:00
Added document type
This commit is contained in:
@@ -15,6 +15,7 @@ from django.db import models
|
||||
from django.template.defaultfilters import slugify
|
||||
from django.utils import timezone
|
||||
|
||||
from reminders.models import Reminder
|
||||
from .managers import LogManager
|
||||
|
||||
|
||||
@@ -189,6 +190,11 @@ class Tag(MatchingModel):
|
||||
help_text="Marks this tag as an archive tag: All documents tagged with archive tags will never be modified automatically (i.e., modifying tags by matching rules)")
|
||||
|
||||
|
||||
class DocumentType(MatchingModel):
|
||||
|
||||
pass
|
||||
|
||||
|
||||
class Document(models.Model):
|
||||
|
||||
TYPE_PDF = "pdf"
|
||||
@@ -215,6 +221,14 @@ class Document(models.Model):
|
||||
|
||||
title = models.CharField(max_length=128, blank=True, db_index=True)
|
||||
|
||||
document_type = models.ForeignKey(
|
||||
DocumentType,
|
||||
blank=True,
|
||||
null=True,
|
||||
related_name="documents",
|
||||
on_delete=models.SET_NULL
|
||||
)
|
||||
|
||||
content = models.TextField(
|
||||
db_index=True,
|
||||
blank=True,
|
||||
|
Reference in New Issue
Block a user