Source

django-helper / django_helper / migrations / 0002_auto__add_model__add_fieldtype__add_field.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 'Model'
        db.create_table('django_helper_model', (
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('name', self.gf('django.db.models.fields.CharField')(max_length=40)),
        ))
        db.send_create_signal('django_helper', ['Model'])

        # Adding model 'FieldType'
        db.create_table('django_helper_fieldtype', (
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('name', self.gf('django.db.models.fields.CharField')(max_length=40)),
            ('backend_storage', self.gf('django.db.models.fields.PositiveSmallIntegerField')()),
        ))
        db.send_create_signal('django_helper', ['FieldType'])

        # Adding model 'Field'
        db.create_table('django_helper_field', (
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('name', self.gf('django.db.models.fields.CharField')(max_length=40)),
            ('model', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['django_helper.Model'])),
            ('field_type', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['django_helper.FieldType'])),
            ('null', self.gf('django.db.models.fields.BooleanField')(default=False)),
            ('blank', self.gf('django.db.models.fields.BooleanField')(default=False)),
            ('db_column', self.gf('django.db.models.fields.CharField')(max_length=40, null=True, blank=True)),
            ('db_index', self.gf('django.db.models.fields.BooleanField')(default=False)),
            ('db_tablespace', self.gf('django.db.models.fields.CharField')(max_length=40, null=True, blank=True)),
            ('default', self.gf('django.db.models.fields.CharField')(max_length=80, null=True, blank=True)),
            ('editable', self.gf('django.db.models.fields.BooleanField')(default=False)),
            ('help_text', self.gf('django.db.models.fields.CharField')(max_length=80, null=True, blank=True)),
            ('primary_key', self.gf('django.db.models.fields.BooleanField')(default=False)),
            ('unique', self.gf('django.db.models.fields.BooleanField')(default=False)),
            ('unique_for_date', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='date_set', null=True, to=orm['django_helper.Field'])),
            ('unique_for_month', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='month_set', null=True, to=orm['django_helper.Field'])),
            ('unique_for_year', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='year_set', null=True, to=orm['django_helper.Field'])),
            ('verbose_name', self.gf('django.db.models.fields.CharField')(max_length=40, null=True, blank=True)),
            ('max_length', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)),
            ('auto_now', self.gf('django.db.models.fields.BooleanField')(default=False)),
            ('auto_now_add', self.gf('django.db.models.fields.BooleanField')(default=False)),
            ('max_digits', self.gf('django.db.models.fields.IntegerField')()),
            ('decimal_places', self.gf('django.db.models.fields.IntegerField')()),
            ('upload_to', self.gf('django.db.models.fields.CharField')(max_length=80, null=True, blank=True)),
            ('othermodel', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='othermodel_set', null=True, to=orm['django_helper.Model'])),
            ('limit_choices_to', self.gf('django.db.models.fields.CharField')(max_length=40, null=True, blank=True)),
            ('related_name', self.gf('django.db.models.fields.CharField')(max_length=40, null=True, blank=True)),
            ('to_field', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='foreign_set', null=True, to=orm['django_helper.Field'])),
            ('on_delete', self.gf('django.db.models.fields.PositiveSmallIntegerField')(null=True, blank=True)),
            ('through', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='through_set', null=True, to=orm['django_helper.Model'])),
            ('db_table', self.gf('django.db.models.fields.CharField')(max_length=40, null=True, blank=True)),
        ))
        db.send_create_signal('django_helper', ['Field'])


    def backwards(self, orm):
        # Deleting model 'Model'
        db.delete_table('django_helper_model')

        # Deleting model 'FieldType'
        db.delete_table('django_helper_fieldtype')

        # Deleting model 'Field'
        db.delete_table('django_helper_field')


    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', 'blank': 'True'})
        },
        'django_helper.field': {
            'Meta': {'object_name': 'Field'},
            'auto_now': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'auto_now_add': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'blank': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'db_column': ('django.db.models.fields.CharField', [], {'max_length': '40', 'null': 'True', 'blank': 'True'}),
            'db_index': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'db_table': ('django.db.models.fields.CharField', [], {'max_length': '40', 'null': 'True', 'blank': 'True'}),
            'db_tablespace': ('django.db.models.fields.CharField', [], {'max_length': '40', 'null': 'True', 'blank': 'True'}),
            'decimal_places': ('django.db.models.fields.IntegerField', [], {}),
            'default': ('django.db.models.fields.CharField', [], {'max_length': '80', 'null': 'True', 'blank': 'True'}),
            'editable': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'field_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['django_helper.FieldType']"}),
            'help_text': ('django.db.models.fields.CharField', [], {'max_length': '80', 'null': 'True', 'blank': 'True'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'limit_choices_to': ('django.db.models.fields.CharField', [], {'max_length': '40', 'null': 'True', 'blank': 'True'}),
            'max_digits': ('django.db.models.fields.IntegerField', [], {}),
            'max_length': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
            'model': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['django_helper.Model']"}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '40'}),
            'null': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'on_delete': ('django.db.models.fields.PositiveSmallIntegerField', [], {'null': 'True', 'blank': 'True'}),
            'othermodel': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'othermodel_set'", 'null': 'True', 'to': "orm['django_helper.Model']"}),
            'primary_key': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'related_name': ('django.db.models.fields.CharField', [], {'max_length': '40', 'null': 'True', 'blank': 'True'}),
            'through': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'through_set'", 'null': 'True', 'to': "orm['django_helper.Model']"}),
            'to_field': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'foreign_set'", 'null': 'True', 'to': "orm['django_helper.Field']"}),
            'unique': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'unique_for_date': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'date_set'", 'null': 'True', 'to': "orm['django_helper.Field']"}),
            'unique_for_month': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'month_set'", 'null': 'True', 'to': "orm['django_helper.Field']"}),
            'unique_for_year': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'year_set'", 'null': 'True', 'to': "orm['django_helper.Field']"}),
            'upload_to': ('django.db.models.fields.CharField', [], {'max_length': '80', 'null': 'True', 'blank': 'True'}),
            'verbose_name': ('django.db.models.fields.CharField', [], {'max_length': '40', 'null': 'True', 'blank': 'True'})
        },
        'django_helper.fieldtype': {
            'Meta': {'object_name': 'FieldType'},
            'backend_storage': ('django.db.models.fields.PositiveSmallIntegerField', [], {}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '40'})
        },
        '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.model': {
            'Meta': {'object_name': 'Model'},
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '40'})
        },
        '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', 'blank': 'True'}),
            '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', 'blank': 'True'})
        }
    }

    complete_apps = ['django_helper']