Ah, right, a book with no chapters...
This commit is contained in:
parent
55f160cb73
commit
a403aa7375
|
@ -9,7 +9,8 @@ class Book(models.Model):
|
|||
|
||||
@property
|
||||
def last_updated(self):
|
||||
return Chapter.objects.filter(book=self).order_by('added')[0].added
|
||||
chaps=Chapter.objects.filter(book=self).order_by('added')
|
||||
return chaps[0].added if chaps else None
|
||||
|
||||
def __str__(self):
|
||||
return self.title
|
||||
|
|
Loading…
Reference in New Issue
Block a user