diff options
| author | Étienne Loks <etienne.loks@iggdrasil.net> | 2019-01-16 11:06:21 +0100 | 
|---|---|---|
| committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2019-01-16 11:06:21 +0100 | 
| commit | d7a01334b49e6d3358bd33990c27c828021400c6 (patch) | |
| tree | a18bf76379e6aa20b472c8aafa391ecab5856c87 /ishtar_common/models.py | |
| parent | c591e3524714fdc170536f6caa47401d8d93ebf6 (diff) | |
| download | Ishtar-d7a01334b49e6d3358bd33990c27c828021400c6.tar.bz2 Ishtar-d7a01334b49e6d3358bd33990c27c828021400c6.zip  | |
Sheets: fix reload after rollback - fix display of the last history version
Diffstat (limited to 'ishtar_common/models.py')
| -rw-r--r-- | ishtar_common/models.py | 6 | 
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  | 
