inbox tags, archive tags, archive serial number for documents

This commit is contained in:
Jonas Winkler
2018-07-06 13:25:02 +02:00
parent 78f0991fb5
commit c03cfb176c
5 changed files with 52 additions and 3 deletions

View File

@@ -41,7 +41,7 @@ class Command(Renderable, BaseCommand):
self.verbosity = options["verbosity"]
for document in Document.objects.filter(correspondent__isnull=True):
for document in Document.objects.filter(correspondent__isnull=True).exclude(tags__is_archived_tag=True):
potential_correspondents = list(
Correspondent.match_all(document.content))

2
src/documents/management/commands/document_retagger.py Normal file → Executable file
View File

@@ -22,7 +22,7 @@ class Command(Renderable, BaseCommand):
self.verbosity = options["verbosity"]
for document in Document.objects.all():
for document in Document.objects.all().exclude(tags__is_archived_tag=True):
tags = Tag.objects.exclude(
pk__in=document.tags.values_list("pk", flat=True))