summaryrefslogtreecommitdiff
path: root/ishtar_common/models.py
diff options
context:
space:
mode:
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 c241b4fad..71868cb63 100644
--- a/ishtar_common/models.py
+++ b/ishtar_common/models.py
@@ -1518,6 +1518,12 @@ class BaseHistorizedItem(DocumentItem, FullSearch, Imported, JsonData,
self.save()
return external_id
+ def get_last_history_date(self):
+ q = self.history.values("history_date").order_by('-history_date')
+ if not q.count():
+ return
+ return q.all()[0]['history_date']
+
def get_previous(self, step=None, date=None, strict=True):
"""
Get a "step" previous state of the item