diff --git a/python/web/library/models.py b/python/web/library/models.py index 8752a4e..1b50871 100644 --- a/python/web/library/models.py +++ b/python/web/library/models.py @@ -30,7 +30,7 @@ class Book(models.Model): published_year = models.IntegerField(null=True, blank=True) edition = models.IntegerField(null=True, blank=True) num_pages = models.IntegerField(null=True, blank=True) - series = models.ForeignKey(BookSeries, null=True, blank=True) + series = models.ForeignKey(BookSeries, related_name='books', null=True, blank=True) description = models.CharField(max_length=1023, null=True, blank=True) picture = models.ImageField(upload_to='%Y/%m/%d/pictures', null=True, blank=True) thumbnail = models.ImageField(upload_to='%Y/%m/%d/thumbnails', null=True, blank=True) @@ -89,7 +89,7 @@ class AlternativeTitle(models.Model): alt_title = models.CharField(max_length=511) class Copy(models.Model): - book = models.ForeignKey(Book) + book = models.ForeignKey(Book, related_name='copies') number = models.IntegerField() owner = models.CharField(max_length=9)