summaryrefslogtreecommitdiff
path: root/ishtar_common/models.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2021-01-05 17:18:33 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2021-02-28 12:15:23 +0100
commitced826479a1ce9b7b231376ce55dba0632d8df89 (patch)
tree5e1a23b6caa2be94919010e68c130086231c8d6b /ishtar_common/models.py
parentd319e01c50deeba74674b9e0a6389f3637ce154a (diff)
downloadIshtar-ced826479a1ce9b7b231376ce55dba0632d8df89.tar.bz2
Ishtar-ced826479a1ce9b7b231376ce55dba0632d8df89.zip
Document: add publishing year
Diffstat (limited to 'ishtar_common/models.py')
-rw-r--r--ishtar_common/models.py6
1 files changed, 6 insertions, 0 deletions
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"),