diff options
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 |
commit | da9baba079fd8ac3ca939c2a8e4f7fd889d9c0ca (patch) | |
tree | f703963dcb757ba0a067129d4c8a8287009b96a5 /archaeological_warehouse/models.py | |
parent | b6a58ae42723a93df08dca35646b6f5ea1270d49 (diff) | |
download | Ishtar-da9baba079fd8ac3ca939c2a8e4f7fd889d9c0ca.tar.bz2 Ishtar-da9baba079fd8ac3ca939c2a8e4f7fd889d9c0ca.zip |
Model: add history for document and containers
Diffstat (limited to 'archaeological_warehouse/models.py')
-rw-r--r-- | archaeological_warehouse/models.py | 13 |
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" |