1 # -*- coding: utf-8 -*-
2 from south.utils import datetime_utils as datetime
3 from south.db import db
4 from south.v2 import SchemaMigration
5 from django.db import models
8 class Migration(SchemaMigration):
10 def forwards(self, orm):
11 # Adding M2M table for field experts on 'Assignment'
12 m2m_table_name = db.shorten_name(u'stage2_assignment_experts')
13 db.create_table(m2m_table_name, (
14 ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
15 ('assignment', models.ForeignKey(orm[u'stage2.assignment'], null=False)),
16 ('user', models.ForeignKey(orm[u'auth.user'], null=False))
18 db.create_unique(m2m_table_name, ['assignment_id', 'user_id'])
21 def backwards(self, orm):
22 # Removing M2M table for field experts on 'Assignment'
23 db.delete_table(db.shorten_name(u'stage2_assignment_experts'))
28 'Meta': {'object_name': 'Group'},
29 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
30 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
31 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
34 'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'},
35 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
36 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}),
37 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
38 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
41 'Meta': {'object_name': 'User'},
42 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
43 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
44 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
45 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Group']"}),
46 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
47 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
48 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
49 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
50 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
51 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
52 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
53 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Permission']"}),
54 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
57 'Meta': {'ordering': "('-created_at',)", 'object_name': 'Contact'},
58 'body': ('jsonfield.fields.JSONField', [], {}),
59 'contact': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
60 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
61 'form_tag': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}),
62 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
63 'ip': ('django.db.models.fields.IPAddressField', [], {'max_length': '15'})
65 u'contenttypes.contenttype': {
66 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
67 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
68 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
69 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
70 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
73 'Meta': {'unique_together': "(['participant', 'assignment'],)", 'object_name': 'Answer'},
74 'assignment': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['stage2.Assignment']"}),
75 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
76 'participant': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['stage2.Participant']"})
78 u'stage2.assignment': {
79 'Meta': {'ordering': "['deadline']", 'object_name': 'Assignment'},
80 'content': ('django.db.models.fields.TextField', [], {}),
81 'deadline': ('django.db.models.fields.DateTimeField', [], {}),
82 'experts': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'stage2_assignments'", 'symmetrical': 'False', 'to': u"orm['auth.User']"}),
83 'file_descriptions': ('jsonfield.fields.JSONField', [], {}),
84 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
85 'max_points': ('django.db.models.fields.IntegerField', [], {}),
86 'title': ('django.db.models.fields.CharField', [], {'max_length': '128'})
88 u'stage2.attachment': {
89 'Meta': {'object_name': 'Attachment'},
90 'answer': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['stage2.Answer']"}),
91 'file': ('django.db.models.fields.files.FileField', [], {'max_length': '100'}),
92 'file_no': ('django.db.models.fields.IntegerField', [], {}),
93 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})
96 'Meta': {'unique_together': "(['expert', 'answer'],)", 'object_name': 'Mark'},
97 'answer': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['stage2.Answer']"}),
98 'expert': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']"}),
99 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
100 'points': ('django.db.models.fields.DecimalField', [], {'max_digits': '3', 'decimal_places': '1'})
102 u'stage2.participant': {
103 'Meta': {'object_name': 'Participant'},
104 'contact': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contact.Contact']", 'null': 'True'}),
105 'email': ('django.db.models.fields.EmailField', [], {'unique': 'True', 'max_length': '100'}),
106 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
107 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
108 'key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}),
109 'key_sent': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
110 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
114 complete_apps = ['stage2']