From 7348e55d3a104abb84ccac05d35d2f5977781f39 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20St=C4=99pniowski?= Date: Thu, 27 Nov 2008 23:50:20 +0100 Subject: [PATCH 1/1] Added fields for MP3 and Ogg Vorbis files to Book model. --- .../0003_add_mp3_and_ogg_files_to_book.py | 13 +++++++++++++ apps/catalogue/models.py | 2 ++ 2 files changed, 15 insertions(+) create mode 100644 apps/catalogue/migrations/0003_add_mp3_and_ogg_files_to_book.py 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') -- 2.20.1