X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/f155d09d81873bcb831186335a94c5a76843a33d..8813f55a1a25b69b77134b93142d94c5363e8ce7:/apps/catalogue/models/book.py diff --git a/apps/catalogue/models/book.py b/apps/catalogue/models/book.py index b1b2730f..c1ae288f 100755 --- a/apps/catalogue/models/book.py +++ b/apps/catalogue/models/book.py @@ -31,8 +31,9 @@ class Book(models.Model): gallery = models.CharField(_('scan gallery name'), max_length=255, blank=True) project = models.ForeignKey(Project, null=True) - #wl_slug = models.CharField(_('title'), max_length=255, null=True, db_index=True, editable=False) - parent = models.ForeignKey('self', null=True, blank=True, verbose_name=_('parent'), related_name="children", editable=False) + # wl_slug = models.CharField(_('title'), max_length=255, null=True, db_index=True, editable=False) + parent = models.ForeignKey( + 'self', null=True, blank=True, verbose_name=_('parent'), related_name="children", editable=False) parent_number = models.IntegerField(_('parent number'), null=True, blank=True, db_index=True, editable=False) # Cache @@ -55,7 +56,6 @@ class Book(models.Model): verbose_name = _('book') verbose_name_plural = _('books') - # Representing # ============ @@ -79,7 +79,10 @@ class Book(models.Model): @models.permalink def get_absolute_url(self): - return ("catalogue_book", [self.slug]) + return "catalogue_book", [self.slug] + + def gallery_path(self): + return os.path.join(settings.MEDIA_ROOT, settings.IMAGE_DIR, self.gallery) def correct_about(self): return "http://%s%s" % (