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