3 from south.db import db
4 from south.v2 import SchemaMigration
5 from django.db import models
7 class Migration(SchemaMigration):
9 def forwards(self, orm):
11 # Adding model 'ButtonGroup'
12 db.create_table('toolbar_buttongroup', (
13 ('position', self.gf('django.db.models.fields.IntegerField')(default=0)),
14 ('slug', self.gf('django.db.models.fields.SlugField')(max_length=50, db_index=True)),
15 ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
16 ('name', self.gf('django.db.models.fields.CharField')(max_length=32)),
18 db.send_create_signal('toolbar', ['ButtonGroup'])
20 # Adding model 'Button'
21 db.create_table('toolbar_button', (
22 ('key_mod', self.gf('django.db.models.fields.PositiveIntegerField')(default=1, blank=True)),
23 ('scriptlet', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['toolbar.Scriptlet'], null=True, blank=True)),
24 ('tooltip', self.gf('django.db.models.fields.CharField')(max_length=120, blank=True)),
25 ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
26 ('link', self.gf('django.db.models.fields.CharField')(default='', max_length=256, blank=True)),
27 ('key', self.gf('django.db.models.fields.CharField')(max_length=1, blank=True)),
28 ('params', self.gf('django.db.models.fields.TextField')(default='[]')),
29 ('label', self.gf('django.db.models.fields.CharField')(max_length=32)),
30 ('slug', self.gf('django.db.models.fields.SlugField')(unique=True, max_length=50, db_index=True)),
32 db.send_create_signal('toolbar', ['Button'])
34 # Adding M2M table for field group on 'Button'
35 db.create_table('toolbar_button_group', (
36 ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
37 ('button', models.ForeignKey(orm['toolbar.button'], null=False)),
38 ('buttongroup', models.ForeignKey(orm['toolbar.buttongroup'], null=False))
40 db.create_unique('toolbar_button_group', ['button_id', 'buttongroup_id'])
42 # Adding model 'Scriptlet'
43 db.create_table('toolbar_scriptlet', (
44 ('code', self.gf('django.db.models.fields.TextField')()),
45 ('name', self.gf('django.db.models.fields.CharField')(max_length=64, primary_key=True)),
47 db.send_create_signal('toolbar', ['Scriptlet'])
50 def backwards(self, orm):
52 # Deleting model 'ButtonGroup'
53 db.delete_table('toolbar_buttongroup')
55 # Deleting model 'Button'
56 db.delete_table('toolbar_button')
58 # Removing M2M table for field group on 'Button'
59 db.delete_table('toolbar_button_group')
61 # Deleting model 'Scriptlet'
62 db.delete_table('toolbar_scriptlet')
67 'Meta': {'object_name': 'Button'},
68 'group': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['toolbar.ButtonGroup']"}),
69 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
70 'key': ('django.db.models.fields.CharField', [], {'max_length': '1', 'blank': 'True'}),
71 'key_mod': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1', 'blank': 'True'}),
72 'label': ('django.db.models.fields.CharField', [], {'max_length': '32'}),
73 'link': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '256', 'blank': 'True'}),
74 'params': ('django.db.models.fields.TextField', [], {'default': "'[]'"}),
75 'scriptlet': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['toolbar.Scriptlet']", 'null': 'True', 'blank': 'True'}),
76 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '50', 'db_index': 'True'}),
77 'tooltip': ('django.db.models.fields.CharField', [], {'max_length': '120', 'blank': 'True'})
79 'toolbar.buttongroup': {
80 'Meta': {'object_name': 'ButtonGroup'},
81 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
82 'name': ('django.db.models.fields.CharField', [], {'max_length': '32'}),
83 'position': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
84 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '50', 'db_index': 'True'})
86 'toolbar.scriptlet': {
87 'Meta': {'object_name': 'Scriptlet'},
88 'code': ('django.db.models.fields.TextField', [], {}),
89 'name': ('django.db.models.fields.CharField', [], {'max_length': '64', 'primary_key': 'True'})
93 complete_apps = ['toolbar']