feat: embed extra data in person csv

Resolves #113
This commit is contained in:
James Graham
2021-05-17 19:29:26 +01:00
parent 264c353b1d
commit 48cce12c32
2 changed files with 10 additions and 0 deletions

View File

@@ -123,6 +123,14 @@ class Person(models.Model):
def current_answers(self) -> 'PersonAnswerSet':
return self.answer_sets.last()
@property
def organisation(self) -> Organisation:
return self.current_answers.organisation
@property
def country_of_residence(self):
return self.current_answers.country_of_residence
def get_absolute_url(self):
return reverse('people:person.detail', kwargs={'pk': self.pk})