Source

django-helper / django_helper / migrations / 0001_initial.py

Full commit
# -*- coding: 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 'Middleware'
        db.create_table('django_helper_middleware', (
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('name', self.gf('django.db.models.fields.CharField')(max_length=40)),
            ('app_name', self.gf('django.db.models.fields.CharField')(max_length=60)),
            ('process_request', self.gf('django.db.models.fields.BooleanField')(default=False)),
            ('process_view', self.gf('django.db.models.fields.BooleanField')(default=False)),
            ('process_template_response', self.gf('django.db.models.fields.BooleanField')(default=False)),
            ('process_response', self.gf('django.db.models.fields.BooleanField')(default=False)),
            ('process_exception', self.gf('django.db.models.fields.BooleanField')(default=False)),
            ('description', self.gf('django.db.models.fields.TextField')()),
            ('added_on', self.gf('django.db.models.fields.DateField')(auto_now_add=True, blank=True)),
        ))
        db.send_create_signal('django_helper', ['Middleware'])

        # Adding model 'ContextProcessor'
        db.create_table('django_helper_contextprocessor', (
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('name', self.gf('django.db.models.fields.SlugField')(max_length=50)),
            ('app_name', self.gf('django.db.models.fields.CharField')(max_length=60)),
            ('description', self.gf('django.db.models.fields.TextField')()),
            ('added_on', self.gf('django.db.models.fields.DateField')(auto_now_add=True, blank=True)),
        ))
        db.send_create_signal('django_helper', ['ContextProcessor'])

        # Adding M2M table for field required_middleware on 'ContextProcessor'
        db.create_table('django_helper_contextprocessor_required_middleware', (
            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
            ('contextprocessor', models.ForeignKey(orm['django_helper.contextprocessor'], null=False)),
            ('middleware', models.ForeignKey(orm['django_helper.middleware'], null=False))
        ))
        db.create_unique('django_helper_contextprocessor_required_middleware', ['contextprocessor_id', 'middleware_id'])

        # Adding model 'TemplateTag'
        db.create_table('django_helper_templatetag', (
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('tag_name', self.gf('django.db.models.fields.SlugField')(max_length=50)),
            ('tag_type', self.gf('django.db.models.fields.PositiveSmallIntegerField')()),
            ('app_name', self.gf('django.db.models.fields.CharField')(max_length=60)),
            ('parameters', self.gf('django.db.models.fields.CharField')(max_length=60, blank=True)),
            ('takes_context', self.gf('django.db.models.fields.BooleanField')(default=False)),
            ('template', self.gf('django.db.models.fields.CharField')(max_length=80)),
            ('examples', self.gf('django.db.models.fields.TextField')()),
            ('description', self.gf('django.db.models.fields.TextField')()),
            ('added_on', self.gf('django.db.models.fields.DateField')(auto_now_add=True, blank=True)),
        ))
        db.send_create_signal('django_helper', ['TemplateTag'])

        # Adding M2M table for field required_context on 'TemplateTag'
        db.create_table('django_helper_templatetag_required_context', (
            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
            ('templatetag', models.ForeignKey(orm['django_helper.templatetag'], null=False)),
            ('contextprocessor', models.ForeignKey(orm['django_helper.contextprocessor'], null=False))
        ))
        db.create_unique('django_helper_templatetag_required_context', ['templatetag_id', 'contextprocessor_id'])


    def backwards(self, orm):
        # Deleting model 'Middleware'
        db.delete_table('django_helper_middleware')

        # Deleting model 'ContextProcessor'
        db.delete_table('django_helper_contextprocessor')

        # Removing M2M table for field required_middleware on 'ContextProcessor'
        db.delete_table('django_helper_contextprocessor_required_middleware')

        # Deleting model 'TemplateTag'
        db.delete_table('django_helper_templatetag')

        # Removing M2M table for field required_context on 'TemplateTag'
        db.delete_table('django_helper_templatetag_required_context')


    models = {
        'django_helper.contextprocessor': {
            'Meta': {'object_name': 'ContextProcessor'},
            'added_on': ('django.db.models.fields.DateField', [], {'auto_now_add': 'True', 'blank': 'True'}),
            'app_name': ('django.db.models.fields.CharField', [], {'max_length': '60'}),
            'description': ('django.db.models.fields.TextField', [], {}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.SlugField', [], {'max_length': '50'}),
            'required_middleware': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['django_helper.Middleware']", 'symmetrical': 'False'})
        },
        'django_helper.middleware': {
            'Meta': {'object_name': 'Middleware'},
            'added_on': ('django.db.models.fields.DateField', [], {'auto_now_add': 'True', 'blank': 'True'}),
            'app_name': ('django.db.models.fields.CharField', [], {'max_length': '60'}),
            'description': ('django.db.models.fields.TextField', [], {}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '40'}),
            'process_exception': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'process_request': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'process_response': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'process_template_response': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'process_view': ('django.db.models.fields.BooleanField', [], {'default': 'False'})
        },
        'django_helper.templatetag': {
            'Meta': {'object_name': 'TemplateTag'},
            'added_on': ('django.db.models.fields.DateField', [], {'auto_now_add': 'True', 'blank': 'True'}),
            'app_name': ('django.db.models.fields.CharField', [], {'max_length': '60'}),
            'description': ('django.db.models.fields.TextField', [], {}),
            'examples': ('django.db.models.fields.TextField', [], {}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'parameters': ('django.db.models.fields.CharField', [], {'max_length': '60', 'blank': 'True'}),
            'required_context': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['django_helper.ContextProcessor']", 'symmetrical': 'False'}),
            'tag_name': ('django.db.models.fields.SlugField', [], {'max_length': '50'}),
            'tag_type': ('django.db.models.fields.PositiveSmallIntegerField', [], {}),
            'takes_context': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'template': ('django.db.models.fields.CharField', [], {'max_length': '80'})
        }
    }

    complete_apps = ['django_helper']