Added migrations to lessons.
authorLukasz Anwajler <lukasz@anwajler.com>
Tue, 18 Jan 2011 14:05:17 +0000 (08:05 -0600)
committerLukasz Anwajler <lukasz@anwajler.com>
Tue, 18 Jan 2011 14:05:17 +0000 (08:05 -0600)
apps/lessons/migrations/0001_initial.py [new file with mode: 0644]
apps/lessons/migrations/0002_auto__add_field_document_html.py [new file with mode: 0644]
apps/lessons/migrations/__init__.py [new file with mode: 0644]
apps/lessons/models.py

diff --git a/apps/lessons/migrations/0001_initial.py b/apps/lessons/migrations/0001_initial.py
new file mode 100644 (file)
index 0000000..9374d61
--- /dev/null
@@ -0,0 +1,45 @@
+# encoding: utf-8
+import datetime
+from south.db import db
+from south.v2 import SchemaMigration
+from django.db import models
+
+class Migration(SchemaMigration):
+
+    def forwards(self, orm):
+        
+        # Adding model 'Document'
+        db.create_table('lessons_document', (
+            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
+            ('title', self.gf('django.db.models.fields.CharField')(max_length=120)),
+            ('slug', self.gf('django.db.models.fields.SlugField')(max_length=50, db_index=True)),
+            ('file', self.gf('django.db.models.fields.files.FileField')(max_length=100)),
+            ('author', self.gf('django.db.models.fields.CharField')(max_length=120, blank=True)),
+            ('slideshare_id', self.gf('django.db.models.fields.CharField')(max_length=120, blank=True)),
+            ('description', self.gf('django.db.models.fields.TextField')(blank=True)),
+            ('created_at', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),
+        ))
+        db.send_create_signal('lessons', ['Document'])
+
+
+    def backwards(self, orm):
+        
+        # Deleting model 'Document'
+        db.delete_table('lessons_document')
+
+
+    models = {
+        'lessons.document': {
+            'Meta': {'object_name': 'Document'},
+            'author': ('django.db.models.fields.CharField', [], {'max_length': '120', 'blank': 'True'}),
+            'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
+            'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
+            'file': ('django.db.models.fields.files.FileField', [], {'max_length': '100'}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'slideshare_id': ('django.db.models.fields.CharField', [], {'max_length': '120', 'blank': 'True'}),
+            'slug': ('django.db.models.fields.SlugField', [], {'max_length': '50', 'db_index': 'True'}),
+            'title': ('django.db.models.fields.CharField', [], {'max_length': '120'})
+        }
+    }
+
+    complete_apps = ['lessons']
diff --git a/apps/lessons/migrations/0002_auto__add_field_document_html.py b/apps/lessons/migrations/0002_auto__add_field_document_html.py
new file mode 100644 (file)
index 0000000..2254bf3
--- /dev/null
@@ -0,0 +1,36 @@
+# encoding: utf-8
+import datetime
+from south.db import db
+from south.v2 import SchemaMigration
+from django.db import models
+
+class Migration(SchemaMigration):
+
+    def forwards(self, orm):
+        
+        # Adding field 'Document.html'
+        db.add_column('lessons_document', 'html', self.gf('django.db.models.fields.TextField')(default=None, blank=True), keep_default=False)
+
+
+    def backwards(self, orm):
+        
+        # Deleting field 'Document.html'
+        db.delete_column('lessons_document', 'html')
+
+
+    models = {
+        'lessons.document': {
+            'Meta': {'object_name': 'Document'},
+            'author': ('django.db.models.fields.CharField', [], {'max_length': '120', 'blank': 'True'}),
+            'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
+            'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
+            'file': ('django.db.models.fields.files.FileField', [], {'max_length': '100'}),
+            'html': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'slideshare_id': ('django.db.models.fields.CharField', [], {'max_length': '120', 'blank': 'True'}),
+            'slug': ('django.db.models.fields.SlugField', [], {'max_length': '50', 'db_index': 'True'}),
+            'title': ('django.db.models.fields.CharField', [], {'max_length': '120'})
+        }
+    }
+
+    complete_apps = ['lessons']
diff --git a/apps/lessons/migrations/__init__.py b/apps/lessons/migrations/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
index ffb2b6c..412dc6b 100644 (file)
@@ -16,6 +16,7 @@ class Document(models.Model):
     slideshare_id = models.CharField(_('slideshare ID'), blank=True, max_length=120)
     description = models.TextField(_('description'), blank=True)
     created_at = models.DateTimeField(auto_now_add=True)
+    html = models.TextField(_('HTML'), blank=True) # HTML content, alternative for Flash
 
     def slideshare_player(self):
         base, ext = path.splitext(self.file.name)