From: Marek Stępniowski Date: Thu, 27 Nov 2008 22:50:20 +0000 (+0100) Subject: Added fields for MP3 and Ogg Vorbis files to Book model. X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/7348e55d3a104abb84ccac05d35d2f5977781f39?ds=sidebyside Added fields for MP3 and Ogg Vorbis files to Book model. --- diff --git a/apps/catalogue/migrations/0003_add_mp3_and_ogg_files_to_book.py b/apps/catalogue/migrations/0003_add_mp3_and_ogg_files_to_book.py new file mode 100644 index 000000000..f4fab130e --- /dev/null +++ b/apps/catalogue/migrations/0003_add_mp3_and_ogg_files_to_book.py @@ -0,0 +1,13 @@ +from south.db import db +from django.db.models import FileField + +class Migration: + + def forwards(self): + db.add_column('catalogue_book', 'mp3_file', FileField()) + db.add_column('catalogue_book', 'ogg_file', FileField()) + + def backwards(self): + db.delete_column('catalogue_book', 'mp3_file') + db.delete_column('catalogue_book', 'ogg_file') + diff --git a/apps/catalogue/models.py b/apps/catalogue/models.py index 483fddab0..7be0f826d 100644 --- a/apps/catalogue/models.py +++ b/apps/catalogue/models.py @@ -94,6 +94,8 @@ class Book(models.Model): pdf_file = models.FileField(_('PDF file'), upload_to=book_upload_path('pdf'), blank=True) odt_file = models.FileField(_('ODT file'), upload_to=book_upload_path('odt'), blank=True) txt_file = models.FileField(_('TXT file'), upload_to=book_upload_path('txt'), blank=True) + mp3_file = models.FileField(_('MP3 file'), upload_to=book_upload_path('mp3'), blank=True) + ogg_file = models.FileField(_('OGG file'), upload_to=book_upload_path('ogg'), blank=True) parent = models.ForeignKey('self', blank=True, null=True, related_name='children')