Commit d144b758 authored by Vincent Michel's avatar Vincent Michel
Browse files

[vtimeline] Add survival data, closes #4084902

parent 6337ca8639e1
......@@ -28,6 +28,7 @@ else:
def call(self):
dates = []
# Date format is %Y,%m,%d for vtimeline sake
d = {'timeline': {'headline': '', 'type': 'default', 'text': '', 'date': dates}}
for entity in self.cw_rset.entities():
# Subject dates
......@@ -74,6 +75,15 @@ else:
if date:
dates.append({'startDate': ustrftime(date, '%Y,%m,%d'),
'headline': drugtake.view('incontext')})
# SurvivalData
for surv in entity.reverse_survival_of:
if surv.lastnews_date:
title = []
for attr in ('state_at_lastnews', 'deceased', 'relapse_date'):
if getattr(surv, attr) is not None:
title.append('%s - %s' % (self._cw._(attr), getattr(surv, attr)))
dates.append({'startDate': ustrftime(surv.lastnews_date, '%Y,%m,%d'),
'headline': '<br/>'.join(title)})
# Add additional data
self.additional_infos(entity, d)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment