From 63a02ec952275c967ebd624ec07d6674a93aee81 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Tue, 5 Jan 2021 17:18:33 +0100 Subject: Document: add publishing year --- ishtar_common/models.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'ishtar_common/models.py') diff --git a/ishtar_common/models.py b/ishtar_common/models.py index 9adba889b..23416d406 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -2864,6 +2864,10 @@ class Document(BaseHistorizedItem, CompleteIdentifierItem, OwnPerms, ImageModel, pgettext_lazy("key for text search", "publisher"), 'publisher__name__iexact' ), + 'publishing_year': SearchAltName( + pgettext_lazy("key for text search", "publishing-year"), + 'publishing_year' + ), 'title': SearchAltName( pgettext_lazy("key for text search", "title"), 'title__iexact' @@ -3097,6 +3101,8 @@ class Document(BaseHistorizedItem, CompleteIdentifierItem, OwnPerms, ImageModel, publisher = models.ForeignKey( Organization, verbose_name=_("Publisher"), blank=True, null=True, related_name='publish') + publishing_year = models.PositiveIntegerField( + _("Year of publication"), blank=True, null=True) licenses = models.ManyToManyField(LicenseType, verbose_name=_("License"), blank=True) tags = models.ManyToManyField(DocumentTag, verbose_name=_("Tags"), -- cgit v1.2.3