summaryrefslogtreecommitdiff
path: root/archaeological_warehouse/models.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2023-01-30 18:57:24 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2023-02-02 17:40:14 +0100
commit07162968d5d47470c8f6e55daec0366b5e5d9b0f (patch)
treef703963dcb757ba0a067129d4c8a8287009b96a5 /archaeological_warehouse/models.py
parent83c180d6b6faa09db5112d4b5cecafc4caa61881 (diff)
downloadIshtar-07162968d5d47470c8f6e55daec0366b5e5d9b0f.tar.bz2
Ishtar-07162968d5d47470c8f6e55daec0366b5e5d9b0f.zip
Model: add history for document and containers
Diffstat (limited to 'archaeological_warehouse/models.py')
-rw-r--r--archaeological_warehouse/models.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/archaeological_warehouse/models.py b/archaeological_warehouse/models.py
index 224fe8b21..00500bdcf 100644
--- a/archaeological_warehouse/models.py
+++ b/archaeological_warehouse/models.py
@@ -34,10 +34,11 @@ from ishtar_common.utils import ugettext_lazy as _, pgettext_lazy
from django.apps import apps
from ishtar_common.data_importer import post_importer_action, pre_importer_action
from ishtar_common.model_managers import ExternalIdManager, UUIDModelManager
-from ishtar_common.models import ValueGetter, get_current_profile
+from ishtar_common.models import ValueGetter, get_current_profile, HistoryModel
from ishtar_common.models_common import (
GeneralType,
- LightHistorizedItem,
+ BaseHistorizedItem,
+ HistoricalRecords,
OwnPerms,
Address,
post_save_cache,
@@ -834,7 +835,7 @@ class ContainerTree(models.Model):
class Container(
DocumentItem,
Merge,
- LightHistorizedItem,
+ BaseHistorizedItem,
CompleteIdentifierItem,
GeoItem,
OwnPerms,
@@ -1047,10 +1048,10 @@ class Container(
"documents__associated_file__isnull",
"documents__associated_url__isnull",
]
- BOOL_FIELDS = LightHistorizedItem.BOOL_FIELDS + ["container_type__stationary"]
+ BOOL_FIELDS = BaseHistorizedItem.BOOL_FIELDS + ["container_type__stationary"]
REVERSED_MANY_COUNTED_FIELDS = ["finds__isnull", "finds_ref"]
- ALT_NAMES.update(LightHistorizedItem.ALT_NAMES)
+ ALT_NAMES.update(BaseHistorizedItem.ALT_NAMES)
ALT_NAMES.update(DocumentItem.ALT_NAMES)
DYNAMIC_REQUESTS = {
@@ -1167,6 +1168,8 @@ class Container(
blank=True,
null=True,
)
+ history_date_deprecated = models.DateTimeField(default=datetime.datetime.now)
+ history = HistoricalRecords(bases=[HistoryModel])
DISABLE_POLYGONS = False
MERGE_ATTRIBUTE = "get_merge_key"