| 60 | |
| 61 | |
| 62 | class Author(models.Model): |
| 63 | first_name = models.CharField(max_length=100) |
| 64 | last_name = models.CharField(max_length=100) |
| 65 | date_of_birth = models.DateField(null=True, blank=True) |
| 66 | date_of_death = models.DateField('Died', null=True, blank=True) |
| 67 | |
| 68 | class Meta: |
| 69 | ordering = ['last_name', 'first_name'] |
| 70 | |
| 71 | def get_absolute_url(self): |
| 72 | """Returns the URL to access a particular author instance.""" |
| 73 | return reverse('author-detail', args=[str(self.id)]) |
| 74 | |
| 75 | def __str__(self): |
| 76 | return f'{self.first_name} {self.last_name}' |
nothing calls this directly
no outgoing calls
no test coverage detected