MCPcopy Create free account
hub / github.com/codemistic/Web-Development / Author

Class Author

locallibrary/catalog/models.py:62–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60
61
62class 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}'

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected