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):
12 db.create_table('forms_form', (
13 ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
14 ('title', self.gf('django.db.models.fields.CharField')(max_length=50)),
15 ('slug', self.gf('django.db.models.fields.SlugField')(unique=True, max_length=100, db_index=True)),
16 ('intro', self.gf('django.db.models.fields.TextField')(blank=True)),
17 ('button_text', self.gf('django.db.models.fields.CharField')(default=u'Submit', max_length=50)),
18 ('response', self.gf('django.db.models.fields.TextField')(blank=True)),
19 ('status', self.gf('django.db.models.fields.IntegerField')(default=2)),
20 ('publish_date', self.gf('django.db.models.fields.DateTimeField')(null=True, blank=True)),
21 ('expiry_date', self.gf('django.db.models.fields.DateTimeField')(null=True, blank=True)),
22 ('login_required', self.gf('django.db.models.fields.BooleanField')(default=False)),
23 ('send_email', self.gf('django.db.models.fields.BooleanField')(default=True)),
24 ('email_from', self.gf('django.db.models.fields.EmailField')(max_length=75, blank=True)),
25 ('email_copies', self.gf('django.db.models.fields.CharField')(max_length=200, blank=True)),
26 ('email_subject', self.gf('django.db.models.fields.CharField')(max_length=200, blank=True)),
27 ('email_message', self.gf('django.db.models.fields.TextField')(blank=True)),
29 db.send_create_signal('forms', ['Form'])
31 # Adding M2M table for field sites on 'Form'
32 db.create_table('forms_form_sites', (
33 ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
34 ('form', models.ForeignKey(orm['forms.form'], null=False)),
35 ('site', models.ForeignKey(orm['sites.site'], null=False))
37 db.create_unique('forms_form_sites', ['form_id', 'site_id'])
39 # Adding model 'Field'
40 db.create_table('forms_field', (
41 ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
42 ('label', self.gf('django.db.models.fields.CharField')(max_length=200)),
43 ('field_type', self.gf('django.db.models.fields.IntegerField')()),
44 ('required', self.gf('django.db.models.fields.BooleanField')(default=True)),
45 ('visible', self.gf('django.db.models.fields.BooleanField')(default=True)),
46 ('choices', self.gf('django.db.models.fields.CharField')(max_length=1000, blank=True)),
47 ('default', self.gf('django.db.models.fields.CharField')(max_length=2000, blank=True)),
48 ('placeholder_text', self.gf('django.db.models.fields.CharField')(max_length=100, blank=True)),
49 ('help_text', self.gf('django.db.models.fields.CharField')(max_length=100, blank=True)),
50 ('form', self.gf('django.db.models.fields.related.ForeignKey')(related_name='fields', to=orm['forms.Form'])),
51 ('_order', self.gf('django.db.models.fields.IntegerField')(default=0)),
53 db.send_create_signal('forms', ['Field'])
55 # Adding model 'FormEntry'
56 db.create_table('forms_formentry', (
57 ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
58 ('entry_time', self.gf('django.db.models.fields.DateTimeField')()),
59 ('form', self.gf('django.db.models.fields.related.ForeignKey')(related_name='entries', to=orm['forms.Form'])),
61 db.send_create_signal('forms', ['FormEntry'])
63 # Adding model 'FieldEntry'
64 db.create_table('forms_fieldentry', (
65 ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
66 ('field_id', self.gf('django.db.models.fields.IntegerField')()),
67 ('value', self.gf('django.db.models.fields.CharField')(max_length=2000)),
68 ('entry', self.gf('django.db.models.fields.related.ForeignKey')(related_name='fields', to=orm['forms.FormEntry'])),
70 db.send_create_signal('forms', ['FieldEntry'])
73 def backwards(self, orm):
75 # Deleting model 'Form'
76 db.delete_table('forms_form')
78 # Removing M2M table for field sites on 'Form'
79 db.delete_table('forms_form_sites')
81 # Deleting model 'Field'
82 db.delete_table('forms_field')
84 # Deleting model 'FormEntry'
85 db.delete_table('forms_formentry')
87 # Deleting model 'FieldEntry'
88 db.delete_table('forms_fieldentry')
93 'Meta': {'ordering': "('_order',)", 'object_name': 'Field'},
94 '_order': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
95 'choices': ('django.db.models.fields.CharField', [], {'max_length': '1000', 'blank': 'True'}),
96 'default': ('django.db.models.fields.CharField', [], {'max_length': '2000', 'blank': 'True'}),
97 'field_type': ('django.db.models.fields.IntegerField', [], {}),
98 'form': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'fields'", 'to': "orm['forms.Form']"}),
99 'help_text': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
100 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
101 'label': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
102 'placeholder_text': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
103 'required': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
104 'visible': ('django.db.models.fields.BooleanField', [], {'default': 'True'})
106 'forms.fieldentry': {
107 'Meta': {'object_name': 'FieldEntry'},
108 'entry': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'fields'", 'to': "orm['forms.FormEntry']"}),
109 'field_id': ('django.db.models.fields.IntegerField', [], {}),
110 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
111 'value': ('django.db.models.fields.CharField', [], {'max_length': '2000'})
114 'Meta': {'object_name': 'Form'},
115 'button_text': ('django.db.models.fields.CharField', [], {'default': "u'Submit'", 'max_length': '50'}),
116 'email_copies': ('django.db.models.fields.CharField', [], {'max_length': '200', 'blank': 'True'}),
117 'email_from': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
118 'email_message': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
119 'email_subject': ('django.db.models.fields.CharField', [], {'max_length': '200', 'blank': 'True'}),
120 'expiry_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
121 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
122 'intro': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
123 'login_required': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
124 'publish_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
125 'response': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
126 'send_email': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
127 'sites': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['sites.Site']", 'symmetrical': 'False'}),
128 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '100', 'db_index': 'True'}),
129 'status': ('django.db.models.fields.IntegerField', [], {'default': '2'}),
130 'title': ('django.db.models.fields.CharField', [], {'max_length': '50'})
133 'Meta': {'object_name': 'FormEntry'},
134 'entry_time': ('django.db.models.fields.DateTimeField', [], {}),
135 'form': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'entries'", 'to': "orm['forms.Form']"}),
136 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})
139 'Meta': {'ordering': "('domain',)", 'object_name': 'Site', 'db_table': "'django_site'"},
140 'domain': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
141 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
142 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
146 complete_apps = ['forms']