Added fields for MP3 and Ogg Vorbis files to Book model.
authorMarek Stępniowski <marek@stepniowski.com>
Thu, 27 Nov 2008 22:50:20 +0000 (23:50 +0100)
committerMarek Stępniowski <marek@stepniowski.com>
Thu, 27 Nov 2008 22:50:20 +0000 (23:50 +0100)
apps/catalogue/migrations/0003_add_mp3_and_ogg_files_to_book.py [new file with mode: 0644]
apps/catalogue/models.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 (file)
index 0000000..f4fab13
--- /dev/null
@@ -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')
+
index 483fdda..7be0f82 100644 (file)
@@ -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')