fixed some issues with the ordering, test cases and migrations.

This commit is contained in:
jonaswinkler
2020-12-16 18:40:19 +01:00
parent 69c04a209a
commit ecfae9dadd
4 changed files with 40 additions and 12 deletions

View File

@@ -13,7 +13,6 @@ from django.contrib.auth.models import User
from django.db import models
from django.db.models.functions import Lower
from django.utils import timezone
from django.utils.text import slugify
from documents.file_handling import archive_name_from_filename
from documents.parsers import get_default_file_extension
@@ -80,9 +79,6 @@ class Correspondent(MatchingModel):
# better safe than sorry.
SAFE_REGEX = re.compile(r"^[\w\- ,.']+$")
class Meta:
ordering = ("name",)
class Tag(MatchingModel):
@@ -206,7 +202,7 @@ class Document(models.Model):
)
class Meta:
ordering = ("correspondent", "title")
ordering = ("-created",)
def __str__(self):
created = datetime.date.isoformat(self.created)