diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2020-03-23 16:33:06 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2020-03-23 16:33:06 +0100 |
commit | ab72e9420b213c21e5f46a9fee06cf1795731317 (patch) | |
tree | 9678400b7b21a22b17ccc4bc5e7b8e46fe51e471 | |
parent | 770b72cd25ad40403648ea7f42302b09b1497095 (diff) | |
download | Ishtar-ab72e9420b213c21e5f46a9fee06cf1795731317.tar.bz2 Ishtar-ab72e9420b213c21e5f46a9fee06cf1795731317.zip |
Public representation: do not display default year - display precise dating for datings
-rw-r--r-- | archaeological_context_records/models.py | 2 | ||||
-rw-r--r-- | archaeological_operations/models.py | 2 | ||||
-rw-r--r-- | example_project/settings.py | 1 |
3 files changed, 4 insertions, 1 deletions
diff --git a/archaeological_context_records/models.py b/archaeological_context_records/models.py index 02b074706..4b25366f0 100644 --- a/archaeological_context_records/models.py +++ b/archaeological_context_records/models.py @@ -88,6 +88,8 @@ class Dating(models.Model): verbose_name_plural = _("Datings") def __str__(self): + if self.precise_dating and self.precise_dating.strip(): + return self.precise_dating.strip() start_date = self.start_date and str(self.start_date) or "" end_date = self.end_date and str(self.end_date) or "" if not start_date and not end_date: diff --git a/archaeological_operations/models.py b/archaeological_operations/models.py index 8a415c0c5..12a6aecf5 100644 --- a/archaeological_operations/models.py +++ b/archaeological_operations/models.py @@ -1213,7 +1213,7 @@ class Operation(ClosedItem, DocumentItem, BaseHistorizedItem, QRCodeItem, def public_representation(self): dct = super(Operation, self).public_representation() dct.update({ - "year": self.year, + "year": self.year if settings.ISHTAR_DEFAULT_YEAR else None, "common-name": self.common_name, "operation-type": self.operation_type and str(self.operation_type), "remains": [str(r) for r in self.remains.all()], diff --git a/example_project/settings.py b/example_project/settings.py index 24c3bee35..ae795d04a 100644 --- a/example_project/settings.py +++ b/example_project/settings.py @@ -253,6 +253,7 @@ LIBREOFFICE_HOST = "localhost" ISHTAR_MAP_MAX_ITEMS = 50000 ISHTAR_QRCODE_VERSION = 6 # density of the QR code ISHTAR_QRCODE_SCALE = 2 # scale of the QR code +ISHTAR_DEFAULT_YEAR = 1900 ISHTAR_FILE_PREFIX = "" |