X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/854b0db58a805fd7ec2d262abda0aef02ca6e469..2c6c52b2ce930a558f7ce64e475e7ae66dc90163:/apps/catalogue/models.py?ds=sidebyside diff --git a/apps/catalogue/models.py b/apps/catalogue/models.py index 1e85cdf01..f811461be 100644 --- a/apps/catalogue/models.py +++ b/apps/catalogue/models.py @@ -173,7 +173,7 @@ def book_upload_path(ext=None): # how to put related book's slug here? if not ext: ext = media.type - return 'lektura/%s.%s' % (slugify(filename), ext) + return 'lektura/%s.%s' % (slugify(media.name), ext) return get_dynamic_path @@ -206,6 +206,7 @@ class Book(models.Model): html_file = models.FileField(_('HTML file'), upload_to=book_upload_path('html'), blank=True) pdf_file = models.FileField(_('PDF file'), upload_to=book_upload_path('pdf'), blank=True) epub_file = models.FileField(_('EPUB file'), upload_to=book_upload_path('epub'), blank=True) + txt_file = models.FileField(_('TXT file'), upload_to=book_upload_path('txt'), blank=True) # other files medias = models.ManyToManyField(BookMedia)