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