Scott Nixon avatar Scott Nixon committed 3e4cdbc

Added benefits and testimonials field.

Comments (0)

Files changed (4)

 	extra = 2
 
 class CoursesAdmin(admin.ModelAdmin):		
-	fields = ['title', 'discussion', 'summary', 'selling', 'is_published', 'sites']
+	fields = ['title', 'discussion', 'summary', 'benefits', 'selling', 'testimonials', 'is_published', 'sites']
 	list_display = ['title', 'is_published',]
 	list_filter = ['createdate']
 	date_hierarchy = 'createdate'
 class CoursesAdminModelForm(forms.ModelForm):
     summary = forms.CharField(widget=WYMEditor())
     selling = forms.CharField(widget=WYMEditor())
+    benefits = forms.CharField(widget=WYMEditor())
+    testimonials = forms.CharField(widget=WYMEditor())
     
     class Meta:
         model = get_model('courses', 'courses')

migrations/0005_auto__add_field_courses_benefits__add_field_courses_testimonials.py

+# 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 'Courses.benefits'
+        db.add_column('courses_courses', 'benefits', self.gf('django.db.models.fields.TextField')(default=datetime.date(2010, 9, 5)), keep_default=False)
+
+        # Adding field 'Courses.testimonials'
+        db.add_column('courses_courses', 'testimonials', self.gf('django.db.models.fields.TextField')(default=datetime.date(2010, 9, 5)), keep_default=False)
+
+
+    def backwards(self, orm):
+        
+        # Deleting field 'Courses.benefits'
+        db.delete_column('courses_courses', 'benefits')
+
+        # Deleting field 'Courses.testimonials'
+        db.delete_column('courses_courses', 'testimonials')
+
+
+    models = {
+        'courses.courses': {
+            'Meta': {'object_name': 'Courses'},
+            'benefits': ('django.db.models.fields.TextField', [], {}),
+            'createdate': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}),
+            'discussion': ('django.db.models.fields.URLField', [], {'max_length': '200'}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'is_published': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
+            'selling': ('django.db.models.fields.TextField', [], {}),
+            'sites': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['sites.Site']", 'symmetrical': 'False'}),
+            'slug': ('autoslug.fields.AutoSlugField', [], {'unique': 'True', 'max_length': '50', 'populate_from': 'None', 'unique_with': '()', 'db_index': 'True'}),
+            'summary': ('django.db.models.fields.TextField', [], {}),
+            'testimonials': ('django.db.models.fields.TextField', [], {}),
+            'title': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}),
+            'updatedate': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'})
+        },
+        'courses.lessons': {
+            'Meta': {'object_name': 'Lessons'},
+            'content': ('django.db.models.fields.TextField', [], {}),
+            'course': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['courses.Courses']"}),
+            'createdate': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'is_published': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
+            'slug': ('autoslug.fields.AutoSlugField', [], {'unique': 'True', 'max_length': '50', 'populate_from': 'None', 'unique_with': '()', 'db_index': 'True'}),
+            'summary': ('django.db.models.fields.TextField', [], {}),
+            'title': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '150'}),
+            'updatedate': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'})
+        },
+        'courses.media': {
+            'Meta': {'object_name': 'Media'},
+            'createdate': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'lesson': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['courses.Lessons']"}),
+            'media': ('django.db.models.fields.URLField', [], {'max_length': '200'}),
+            'title': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+            'type': ('django.db.models.fields.CharField', [], {'default': '1', 'max_length': '2'}),
+            'updatedate': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'})
+        },
+        'sites.site': {
+            'Meta': {'object_name': 'Site', 'db_table': "'django_site'"},
+            'domain': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
+        }
+    }
+
+    complete_apps = ['courses']
     title = models.CharField(max_length=100,unique=True)
     summary = models.TextField()
     selling = models.TextField()
+    benefits = models.TextField()
+    testimonials = models.TextField()
     slug = AutoSlugField(populate_from='title', always_update=True, verbose_name='Course URL', max_length=50,unique=True)
     discussion = models.URLField()
     createdate = models.DateTimeField(auto_now_add=True,null=True)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.