From e1a3d19f4b28c9b77bc711d7222e163b8f41a1ff Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Thu, 29 Aug 2019 23:38:02 +0200 Subject: Document generation: manage periods --- archaeological_context_records/models.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'archaeological_context_records') diff --git a/archaeological_context_records/models.py b/archaeological_context_records/models.py index d2325082d..3b236346d 100644 --- a/archaeological_context_records/models.py +++ b/archaeological_context_records/models.py @@ -90,6 +90,17 @@ class Dating(models.Model): return str(self.period) return "%s (%s-%s)" % (self.period, start_date, end_date) + def get_values(self, prefix='', no_values=False): + return { + prefix + "period": str(self.period), + prefix + "start_date": self.start_date or '', + prefix + "end_date": self.end_date or "", + prefix + "dating_type": + str(self.dating_type) if self.dating_type else "", + prefix + "quality": str(self.quality) if self.quality else "", + prefix + "precise_dating": self.precise_dating + } + HISTORY_ATTR = ["period", "start_date", "end_date", "dating_type", "quality", "precise_dating"] -- cgit v1.2.3