3 from south.db import db
4 from south.v2 import DataMigration
5 from django.db import models
6 from forum.migrations import ProgressBar
8 class Migration(DataMigration):
10 def forwards(self, orm):
11 r_count = orm.ActionRepute.objects.count()
12 print "\nAdding dates to %d repute actions:" % r_count
13 progress = ProgressBar(r_count)
15 for r in orm.ActionRepute.objects.all():
19 r.date = a.canceled_at
21 r.date = a.action_date
30 def backwards(self, orm):
31 "Write your backwards methods here."
35 'Meta': {'object_name': 'Group'},
36 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
37 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
38 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'blank': 'True'})
41 'Meta': {'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
42 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
43 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
44 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
45 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
48 'Meta': {'object_name': 'User'},
49 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
50 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
51 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
52 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'blank': 'True'}),
53 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
54 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
55 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
56 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
57 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
58 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
59 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
60 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'blank': 'True'}),
61 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
63 'contenttypes.contenttype': {
64 'Meta': {'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
65 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
66 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
67 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
68 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
71 'Meta': {'object_name': 'Action'},
72 'action_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
73 'action_type': ('django.db.models.fields.CharField', [], {'max_length': '16'}),
74 'canceled': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
75 'canceled_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}),
76 'canceled_by': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'canceled_actions'", 'null': 'True', 'to': "orm['forum.User']"}),
77 'canceled_ip': ('django.db.models.fields.CharField', [], {'max_length': '16'}),
78 'extra': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
79 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
80 'ip': ('django.db.models.fields.CharField', [], {'max_length': '16'}),
81 'node': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'actions'", 'null': 'True', 'to': "orm['forum.Node']"}),
82 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'actions'", 'to': "orm['forum.User']"})
84 'forum.actionrepute': {
85 'Meta': {'object_name': 'ActionRepute'},
86 'action': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'reputes'", 'to': "orm['forum.Action']"}),
87 'by_canceled': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
88 'date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
89 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
90 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'reputes'", 'to': "orm['forum.User']"}),
91 'value': ('django.db.models.fields.IntegerField', [], {'default': '0'})
93 'forum.authkeyuserassociation': {
94 'Meta': {'object_name': 'AuthKeyUserAssociation'},
95 'added_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
96 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
97 'key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}),
98 'provider': ('django.db.models.fields.CharField', [], {'max_length': '64'}),
99 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'auth_keys'", 'to': "orm['forum.User']"})
102 'Meta': {'object_name': 'Award', 'db_table': "u'award'"},
103 'awarded_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
104 'badge': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'award_badge'", 'to': "orm['forum.Badge']"}),
105 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
106 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
107 'notified': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
108 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {}),
109 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'awards'", 'to': "orm['forum.User']"})
112 'Meta': {'unique_together': "(('name', 'type'),)", 'object_name': 'Badge', 'db_table': "u'badge'"},
113 'awarded_count': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),
114 'awarded_to': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'badges'", 'through': "'Award'", 'to': "orm['forum.User']"}),
115 'description': ('django.db.models.fields.CharField', [], {'max_length': '300'}),
116 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
117 'multiple': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
118 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
119 'slug': ('django.db.models.fields.SlugField', [], {'db_index': 'True', 'max_length': '50', 'blank': 'True'}),
120 'type': ('django.db.models.fields.SmallIntegerField', [], {})
123 'Meta': {'object_name': 'KeyValue'},
124 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
125 'key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}),
126 'value': ('forum.models.utils.PickledObjectField', [], {})
129 'Meta': {'object_name': 'MarkedTag'},
130 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
131 'reason': ('django.db.models.fields.CharField', [], {'max_length': '16'}),
132 'tag': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'user_selections'", 'to': "orm['forum.Tag']"}),
133 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'tag_selections'", 'to': "orm['forum.User']"})
136 'Meta': {'object_name': 'Node'},
137 'abs_parent': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'all_children'", 'null': 'True', 'to': "orm['forum.Node']"}),
138 'active_revision': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'active'", 'unique': 'True', 'null': 'True', 'to': "orm['forum.NodeRevision']"}),
139 'added_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
140 'author': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'nodes'", 'to': "orm['forum.User']"}),
141 'body': ('django.db.models.fields.TextField', [], {}),
142 'deleted': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'deleted_node'", 'unique': 'True', 'null': 'True', 'to': "orm['forum.Action']"}),
143 'extra_action': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'extra_node'", 'null': 'True', 'to': "orm['forum.Action']"}),
144 'extra_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
145 'extra_ref': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['forum.Node']", 'null': 'True'}),
146 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
147 'last_activity_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
148 'last_activity_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['forum.User']", 'null': 'True'}),
149 'last_edited': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'edited_node'", 'unique': 'True', 'null': 'True', 'to': "orm['forum.Action']"}),
150 'marked': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
151 'node_type': ('django.db.models.fields.CharField', [], {'default': "'node'", 'max_length': '16'}),
152 'parent': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'children'", 'null': 'True', 'to': "orm['forum.Node']"}),
153 'score': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
154 'tagnames': ('django.db.models.fields.CharField', [], {'max_length': '125'}),
155 'tags': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'nodes'", 'to': "orm['forum.Tag']"}),
156 'title': ('django.db.models.fields.CharField', [], {'max_length': '300'}),
157 'wiki': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'})
159 'forum.noderevision': {
160 'Meta': {'unique_together': "(('node', 'revision'),)", 'object_name': 'NodeRevision'},
161 'author': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'noderevisions'", 'to': "orm['forum.User']"}),
162 'body': ('django.db.models.fields.TextField', [], {}),
163 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
164 'node': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'revisions'", 'to': "orm['forum.Node']"}),
165 'revised_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
166 'revision': ('django.db.models.fields.PositiveIntegerField', [], {}),
167 'summary': ('django.db.models.fields.CharField', [], {'max_length': '300'}),
168 'tagnames': ('django.db.models.fields.CharField', [], {'max_length': '125'}),
169 'title': ('django.db.models.fields.CharField', [], {'max_length': '300'})
171 'forum.openidassociation': {
172 'Meta': {'object_name': 'OpenIdAssociation'},
173 'assoc_type': ('django.db.models.fields.TextField', [], {'max_length': '64'}),
174 'handle': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
175 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
176 'issued': ('django.db.models.fields.IntegerField', [], {}),
177 'lifetime': ('django.db.models.fields.IntegerField', [], {}),
178 'secret': ('django.db.models.fields.TextField', [], {'max_length': '255'}),
179 'server_url': ('django.db.models.fields.TextField', [], {'max_length': '2047'})
181 'forum.openidnonce': {
182 'Meta': {'object_name': 'OpenIdNonce'},
183 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
184 'salt': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
185 'server_url': ('django.db.models.fields.URLField', [], {'max_length': '200'}),
186 'timestamp': ('django.db.models.fields.IntegerField', [], {})
188 'forum.questionsubscription': {
189 'Meta': {'object_name': 'QuestionSubscription'},
190 'auto_subscription': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
191 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
192 'last_view': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2010, 4, 29, 21, 21, 16, 237000)'}),
193 'question': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['forum.Node']"}),
194 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['forum.User']"})
196 'forum.subscriptionsettings': {
197 'Meta': {'object_name': 'SubscriptionSettings'},
198 'all_questions': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
199 'all_questions_watched_tags': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
200 'enable_notifications': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
201 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
202 'member_joins': ('django.db.models.fields.CharField', [], {'default': "'n'", 'max_length': '1'}),
203 'new_question': ('django.db.models.fields.CharField', [], {'default': "'d'", 'max_length': '1'}),
204 'new_question_watched_tags': ('django.db.models.fields.CharField', [], {'default': "'i'", 'max_length': '1'}),
205 'notify_accepted': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
206 'notify_answers': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
207 'notify_comments': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
208 'notify_comments_own_post': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
209 'notify_reply_to_comments': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
210 'questions_answered': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
211 'questions_asked': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
212 'questions_commented': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
213 'questions_viewed': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
214 'subscribed_questions': ('django.db.models.fields.CharField', [], {'default': "'i'", 'max_length': '1'}),
215 'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'subscription_settings'", 'unique': 'True', 'to': "orm['forum.User']"})
218 'Meta': {'object_name': 'Tag', 'db_table': "u'tag'"},
219 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'created_tags'", 'to': "orm['forum.User']"}),
220 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
221 'deleted_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
222 'deleted_by': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'deleted_tags'", 'null': 'True', 'to': "orm['forum.User']"}),
223 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
224 'marked_by': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'marked_tags'", 'through': "'MarkedTag'", 'to': "orm['forum.User']"}),
225 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}),
226 'used_count': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'})
229 'Meta': {'object_name': 'User', '_ormbases': ['auth.User']},
230 'about': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
231 'bronze': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),
232 'date_of_birth': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
233 'email_isvalid': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
234 'email_key': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}),
235 'gold': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),
236 'hide_ignored_questions': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
237 'is_approved': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
238 'last_seen': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
239 'location': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
240 'questions_per_page': ('django.db.models.fields.SmallIntegerField', [], {'default': '10'}),
241 'real_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
242 'reputation': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1'}),
243 'silver': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),
244 'subscriptions': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'subscribers'", 'through': "'QuestionSubscription'", 'to': "orm['forum.Node']"}),
245 'user_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True', 'primary_key': 'True'}),
246 'website': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'})
248 'forum.validationhash': {
249 'Meta': {'unique_together': "(('user', 'type'),)", 'object_name': 'ValidationHash'},
250 'expiration': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2010, 4, 30, 21, 21, 16, 298000)'}),
251 'hash_code': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}),
252 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
253 'seed': ('django.db.models.fields.CharField', [], {'max_length': '12'}),
254 'type': ('django.db.models.fields.CharField', [], {'max_length': '12'}),
255 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['forum.User']"})
259 complete_apps = ['forum']