Added document type

This commit is contained in:
Jonas Winkler
2018-08-24 13:45:15 +02:00
parent dfa5ea423f
commit d7ab69fed9
9 changed files with 222 additions and 10 deletions

View File

@@ -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,