text: # -*- coding: utf-8 -*-
  from south.db import db
  from south.v2 import SchemaMigration
  
  
  class Migration(SchemaMigration):
  
      def forwards(self, orm):
          # Adding model 'ExternalApp'
          db.create_table('externalapps_externalapp', (
              ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
              ('course', self.gf('django.db.models.fields.related.ForeignKey')(related_name='external_apps', null=True, to=orm['courses.Course'])),
              ('app_name', self.gf('django.db.models.fields.CharField')(max_length=200)),
              ('base_url', self.gf('django.db.models.fields.TextField')()),
              ('ip_address', self.gf('django.db.models.fields.IPAddressField')(max_length=15)),
              ('slug', self.gf('django.db.models.fields.SlugField')(max_length=50)),
              ('status', self.gf('django.db.models.fields.SmallIntegerField')(default=2)),
              ('instance_type', self.gf('django.db.models.fields.CharField')(default='askbot', max_length=50)),
              ('execute_task_on_save', self.gf('django.db.models.fields.NullBooleanField')(null=True, blank=True)),
              ('visibility', self.gf('django.db.models.fields.SmallIntegerField')(default=1)),
          ))
          db.send_create_signal('externalapps', ['ExternalApp'])
  
          # Adding unique constraint on 'ExternalApp', fields ['ip_address', 'slug']
          db.create_unique('externalapps_externalapp', ['ip_address', 'slug'])
  
  
      def backwards(self, orm):
          # Removing unique constraint on 'ExternalApp', fields ['ip_address', 'slug']
          db.delete_unique('externalapps_externalapp', ['ip_address', 'slug'])
  
          # Deleting model 'ExternalApp'
          db.delete_table('externalapps_externalapp')
  
  
      models = {
          'auth.group': {
              'Meta': {'object_name': 'Group'},
              'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
              'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
              'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
          },
          'auth.permission': {
              'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
              'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
              'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
              'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
              'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
          },
          'auth.user': {
              'Meta': {'object_name': 'User'},
              'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
              'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
              'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
              'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
              'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
              'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
              'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
              'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
              'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
              'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
              'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
              'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
              'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
          },
          'badges.badge': {
              'Meta': {'ordering': "['-modified', '-created']", 'object_name': 'Badge'},
              'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
              'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
              'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
              'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '100'}),
              'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
              'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '50'}),
              'title': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'})
          },
          'contenttypes.contenttype': {
              'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
              'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
              'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
              'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
              'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
          },
          'courses.course': {
              'Meta': {'ordering': "['order']", 'object_name': 'Course'},
              'certification_available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
              'certification_banner': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
              'completion_badge': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'course'", 'unique': 'True', 'null': 'True', 'to': "orm['badges.Badge']"}),
              'description': ('tinymce.models.HTMLField', [], {}),
              'end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
              'enrollment_method': ('django.db.models.fields.CharField', [], {'default': "'free'", 'max_length': '200'}),
              'estimated_effort': ('tinymce.models.HTMLField', [], {'null': 'True', 'blank': 'True'}),
              'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
              'intended_audience': ('tinymce.models.HTMLField', [], {'null': 'True', 'blank': 'True'}),
              'learning_goals': ('tinymce.models.HTMLField', [], {'blank': 'True'}),
              'max_reservations_pending': ('django.db.models.fields.PositiveSmallIntegerField', [], {'default': '8'}),
              'max_reservations_total': ('django.db.models.fields.PositiveSmallIntegerField', [], {'default': '8'}),
              'name': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
              'order': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1', 'db_index': 'True'}),
              'owner': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'courses_as_owner'", 'to': "orm['auth.User']"}),
              'promotion_media_content_id': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
              'promotion_media_content_type': ('django.db.models.fields.CharField', [], {'max_length': '20', 'null': 'True', 'blank': 'True'}),
              'requirements': ('tinymce.models.HTMLField', [], {'blank': 'True'}),
              'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '50'}),
              'start_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
              'status': ('django.db.models.fields.CharField', [], {'default': "'d'", 'max_length': '10'}),
              'students': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "'courses_as_student'", 'blank': 'True', 'to': "orm['auth.User']"}),
              'teachers': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'courses_as_teacher'", 'symmetrical': 'False', 'through': "orm['courses.CourseTeacher']", 'to': "orm['auth.User']"}),
              'threshold': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '4', 'decimal_places': '2', 'blank': 'True'})
          },
          'courses.courseteacher': {
              'Meta': {'ordering': "['order']", 'object_name': 'CourseTeacher'},
              'course': ('adminsortable.fields.SortableForeignKey', [], {'to': "orm['courses.Course']"}),
              'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
              'order': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1', 'db_index': 'True'}),
              'teacher': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"})
          },
          'externalapps.externalapp': {
              'Meta': {'unique_together': "(('ip_address', 'slug'),)", 'object_name': 'ExternalApp'},
              'app_name': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
              'base_url': ('django.db.models.fields.TextField', [], {}),
              'course': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'external_apps'", 'null': 'True', 'to': "orm['courses.Course']"}),
              'execute_task_on_save': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}),
              'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
              'instance_type': ('django.db.models.fields.CharField', [], {'default': "'askbot'", 'max_length': '50'}),
              'ip_address': ('django.db.models.fields.IPAddressField', [], {'max_length': '15'}),
              'slug': ('django.db.models.fields.SlugField', [], {'max_length': '50'}),
              'status': ('django.db.models.fields.SmallIntegerField', [], {'default': '2'}),
              'visibility': ('django.db.models.fields.SmallIntegerField', [], {'default': '1'})
          }
      }
  
      complete_apps = ['externalapps']
  