feat(people): Allow people to describe relationships

Creating a relationship requires answering each of the
relationship questions

resolve #2
partial #5
This commit is contained in:
James Graham
2020-02-20 14:46:51 +00:00
parent e1df999108
commit 5a1b043862
7 changed files with 147 additions and 1 deletions

View File

@@ -139,5 +139,11 @@ class Relationship(models.Model):
on_delete=models.CASCADE,
blank=False, null=False)
#: Answers to :class:`RelationshipQuestion`s
question_answers = models.ManyToManyField(RelationshipQuestionChoice)
def get_absolute_url(self):
return reverse('people:relationship.detail', kwargs={'pk': self.pk})
def __str__(self) -> str:
return f'{self.source} -> {self.target}'