Set contact serializer

This commit is contained in:
Aarni Halinen
2019-09-26 20:43:13 +03:00
parent e365c394d8
commit 5a29c8c49d
3 changed files with 42 additions and 3 deletions
+2 -2
View File
@@ -192,10 +192,10 @@ class Occupation(models.Model):
start_date = models.DateField(_('Start date'))
end_date = models.DateField(_('End date'))
occupation = models.ForeignKey('Role', on_delete=models.SET_NULL, null=True)
role = models.OneToOneField('Role', on_delete=models.SET_NULL, null=True)
def __str__(self):
return '{}: {} - {}'.format(self.occupation.name, self.start_date, self.end_date)
return '{}: {} - {}'.format(self.role.name, self.start_date, self.end_date)
class Official(models.Model):