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 supervisors on 'Assignment'
12 m2m_table_name = db.shorten_name(u'stage2_assignment_supervisors')
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 supervisors on 'Assignment'
23 db.delete_table(db.shorten_name(u'stage2_assignment_supervisors'))
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 'complete': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
76 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
77 'need_arbiter': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
78 'participant': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['stage2.Participant']"})
80 u'stage2.assignment': {
81 'Meta': {'ordering': "['deadline', 'title']", 'object_name': 'Assignment'},
82 'arbiters': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "'stage2_arbitrated'", 'blank': 'True', 'to': u"orm['auth.User']"}),
83 'content': ('django.db.models.fields.TextField', [], {}),
84 'content_url': ('django.db.models.fields.URLField', [], {'max_length': '200'}),
85 'deadline': ('django.db.models.fields.DateTimeField', [], {}),
86 'experts': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'stage2_assignments'", 'symmetrical': 'False', 'to': u"orm['auth.User']"}),
87 'file_descriptions': ('jsonfield.fields.JSONField', [], {}),
88 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
89 'max_points': ('django.db.models.fields.IntegerField', [], {}),
90 'supervisors': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'stage2_supervised'", 'symmetrical': 'False', 'to': u"orm['auth.User']"}),
91 'title': ('django.db.models.fields.CharField', [], {'max_length': '128'})
93 u'stage2.attachment': {
94 'Meta': {'ordering': "['file_no']", 'object_name': 'Attachment'},
95 'answer': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['stage2.Answer']"}),
96 'file': ('django.db.models.fields.files.FileField', [], {'max_length': '100'}),
97 'file_no': ('django.db.models.fields.IntegerField', [], {}),
98 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})
101 'Meta': {'unique_together': "(['expert', 'answer'],)", 'object_name': 'Mark'},
102 'answer': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['stage2.Answer']"}),
103 'expert': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']"}),
104 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
105 'points': ('django.db.models.fields.DecimalField', [], {'max_digits': '3', 'decimal_places': '1'})
107 u'stage2.participant': {
108 'Meta': {'object_name': 'Participant'},
109 'complete_set': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
110 'contact': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contact.Contact']", 'null': 'True'}),
111 'email': ('django.db.models.fields.EmailField', [], {'unique': 'True', 'max_length': '100'}),
112 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
113 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
114 'key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}),
115 'key_sent': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
116 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
120 complete_apps = ['stage2']