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):
12 question_count = orm.Question.objects.all().count()
13 print "\nConverting %d questions:" % question_count
14 progress = ProgressBar(question_count)
18 for q in orm.Question.objects.order_by('id'):
24 vote_up_count=q.vote_up_count,
25 vote_down_count=q.vote_down_count,
26 offensive_flag_count=q.offensive_flag_count,
27 last_edited_at=q.last_edited_at,
28 last_edited_by=q.last_edited_by,
32 deleted_by=q.deleted_by,
33 deleted_at=q.deleted_at,
35 comment_count=q.comment_count,
41 node.tags = q.tags.all()
43 question_id_map[q.id] = node
49 answer_count = orm.Answer.objects.all().count()
50 print "Converting %d answers:" % answer_count
51 progress = ProgressBar(answer_count)
55 for a in orm.Answer.objects.order_by('id'):
58 parent=question_id_map[a.question.id],
62 vote_up_count=a.vote_up_count,
63 vote_down_count=a.vote_down_count,
64 offensive_flag_count=a.offensive_flag_count,
65 last_edited_at=a.last_edited_at,
66 last_edited_by=a.last_edited_by,
69 deleted_by=a.deleted_by,
70 deleted_at=a.deleted_at,
71 comment_count=a.comment_count,
77 answer_id_map[a.id] = node
82 ctypes = dict([(ct.name, ct.id) for ct in orm['contenttypes.ContentType'].objects.all()])
85 vote_count = orm.Vote.objects.all().count()
86 print "Converting %d vote references:" % vote_count
87 progress = ProgressBar(vote_count)
90 for v in orm.Vote.objects.all():
91 node = (v.content_type.id == ctypes['question']) and question_id_map.get(v.object_id, None) \
92 or answer_id_map.get(v.object_id, None)
104 print "Deleted %d orfan votes"
109 flag_count = orm.FlaggedItem.objects.all().count()
110 print "Converting %d flag references:" % flag_count
111 progress = ProgressBar(flag_count)
114 for f in orm.FlaggedItem.objects.all():
115 node = (f.content_type.id == ctypes['question']) and question_id_map.get(f.object_id, None) \
116 or answer_id_map.get(f.object_id, None)
128 print "Deleted %d orfan votes"
133 comment_count = orm.Comment.objects.all().count()
134 print "Converting %d comment references:" % comment_count
135 progress = ProgressBar(comment_count)
138 for c in orm.Comment.objects.all():
139 node = (c.content_type.id == ctypes['question']) and question_id_map.get(c.object_id, None) \
140 or answer_id_map.get(c.object_id, None)
152 print "Deleted %d orfan comments"
158 awards = orm.Award.objects.filter(content_type__id__in=(ctypes['question'], ctypes['answer']))
159 award_count = awards.count()
160 print "Converting %d award references:" % award_count
161 progress = ProgressBar(award_count)
164 node = (a.content_type.id == ctypes['question']) and question_id_map.get(a.object_id, None) \
165 or answer_id_map.get(a.object_id, None)
168 a.object_id = node.id
177 activities = orm.Activity.objects.filter(content_type__id__in=(ctypes['question'], ctypes['answer']))
178 activity_count = activities.count()
179 print "Converting %d activity references:" % activity_count
180 progress = ProgressBar(activity_count)
183 node = (a.content_type.id == ctypes['question']) and question_id_map.get(a.object_id, None) \
184 or answer_id_map.get(a.object_id, None)
187 a.object_id = node.id
195 def backwards(self, orm):
196 "Write your backwards methods here."
200 'Meta': {'object_name': 'Group'},
201 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
202 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
203 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'blank': 'True'})
206 'Meta': {'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
207 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
208 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
209 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
210 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
213 'Meta': {'object_name': 'User'},
214 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
215 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
216 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
217 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'blank': 'True'}),
218 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
219 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
220 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
221 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
222 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
223 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
224 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
225 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'blank': 'True'}),
226 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
228 'contenttypes.contenttype': {
229 'Meta': {'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
230 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
231 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
232 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
233 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
236 'Meta': {'object_name': 'Activity', 'db_table': "u'activity'"},
237 'active_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
238 'activity_type': ('django.db.models.fields.SmallIntegerField', [], {}),
239 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
240 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
241 'is_auditted': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
242 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {}),
243 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['forum.User']"})
245 'forum.anonymousanswer': {
246 'Meta': {'object_name': 'AnonymousAnswer'},
247 'added_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
248 'author': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['forum.User']", 'null': 'True'}),
249 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
250 'ip_addr': ('django.db.models.fields.IPAddressField', [], {'max_length': '15'}),
251 'question': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'anonymous_answers'", 'to': "orm['forum.Question']"}),
252 'session_key': ('django.db.models.fields.CharField', [], {'max_length': '40'}),
253 'summary': ('django.db.models.fields.CharField', [], {'max_length': '180'}),
254 'text': ('django.db.models.fields.TextField', [], {}),
255 'wiki': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'})
257 'forum.anonymousquestion': {
258 'Meta': {'object_name': 'AnonymousQuestion'},
259 'added_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
260 'author': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['forum.User']", 'null': 'True'}),
261 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
262 'ip_addr': ('django.db.models.fields.IPAddressField', [], {'max_length': '15'}),
263 'session_key': ('django.db.models.fields.CharField', [], {'max_length': '40'}),
264 'summary': ('django.db.models.fields.CharField', [], {'max_length': '180'}),
265 'tagnames': ('django.db.models.fields.CharField', [], {'max_length': '125'}),
266 'text': ('django.db.models.fields.TextField', [], {}),
267 'title': ('django.db.models.fields.CharField', [], {'max_length': '300'}),
268 'wiki': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'})
271 'Meta': {'object_name': 'Answer', 'db_table': "u'answer'"},
272 'accepted': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
273 'accepted_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
274 'accepted_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['forum.User']", 'null': 'True'}),
275 'added_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
276 'author': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'answers'", 'to': "orm['forum.User']"}),
277 'comment_count': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),
278 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
279 'deleted_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
280 'deleted_by': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'deleted_answers'", 'null': 'True', 'to': "orm['forum.User']"}),
281 'html': ('django.db.models.fields.TextField', [], {}),
282 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
283 'last_edited_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
284 'last_edited_by': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'last_edited_answers'", 'null': 'True', 'to': "orm['forum.User']"}),
285 'node_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['forum.Node']", 'unique': 'True', 'null': 'True'}),
286 'offensive_flag_count': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}),
287 'question': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'answers'", 'to': "orm['forum.Question']"}),
288 'score': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
289 'vote_down_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
290 'vote_up_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
291 'wiki': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
292 'wikified_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'})
294 'forum.answerrevision': {
295 'Meta': {'object_name': 'AnswerRevision', 'db_table': "u'answer_revision'"},
296 'answer': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'revisions'", 'to': "orm['forum.Answer']"}),
297 'author': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'answerrevisions'", 'to': "orm['forum.User']"}),
298 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
299 'revised_at': ('django.db.models.fields.DateTimeField', [], {}),
300 'revision': ('django.db.models.fields.PositiveIntegerField', [], {}),
301 'summary': ('django.db.models.fields.CharField', [], {'max_length': '300', 'blank': 'True'}),
302 'text': ('django.db.models.fields.TextField', [], {})
304 'forum.authkeyuserassociation': {
305 'Meta': {'object_name': 'AuthKeyUserAssociation'},
306 'added_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
307 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
308 'key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}),
309 'provider': ('django.db.models.fields.CharField', [], {'max_length': '64'}),
310 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'auth_keys'", 'to': "orm['forum.User']"})
313 'Meta': {'unique_together': "(('content_type', 'object_id', 'user', 'badge'),)", 'object_name': 'Award', 'db_table': "u'award'"},
314 'awarded_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
315 'badge': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'award_badge'", 'to': "orm['forum.Badge']"}),
316 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
317 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
318 'notified': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
319 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {}),
320 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'awards'", 'to': "orm['forum.User']"})
323 'Meta': {'unique_together': "(('name', 'type'),)", 'object_name': 'Badge', 'db_table': "u'badge'"},
324 'awarded_count': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),
325 'awarded_to': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'badges'", 'through': "'Award'", 'to': "orm['forum.User']"}),
326 'description': ('django.db.models.fields.CharField', [], {'max_length': '300'}),
327 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
328 'multiple': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
329 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
330 'slug': ('django.db.models.fields.SlugField', [], {'db_index': 'True', 'max_length': '50', 'blank': 'True'}),
331 'type': ('django.db.models.fields.SmallIntegerField', [], {})
334 'Meta': {'object_name': 'Comment', 'db_table': "u'comment'"},
335 'added_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
336 'comment': ('django.db.models.fields.CharField', [], {'max_length': '300'}),
337 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
338 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
339 'deleted_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
340 'deleted_by': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'deleted_comments'", 'null': 'True', 'to': "orm['forum.User']"}),
341 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
342 'liked_by': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'comments_liked'", 'through': "'LikedComment'", 'to': "orm['forum.User']"}),
343 'node': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'comments'", 'null': 'True', 'to': "orm['forum.Node']"}),
344 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {}),
345 'score': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
346 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'comments'", 'to': "orm['forum.User']"})
348 'forum.favoritequestion': {
349 'Meta': {'unique_together': "(('question', 'user'),)", 'object_name': 'FavoriteQuestion', 'db_table': "u'favorite_question'"},
350 'added_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
351 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
352 'question': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['forum.Question']"}),
353 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'user_favorite_questions'", 'to': "orm['forum.User']"})
355 'forum.flaggeditem': {
356 'Meta': {'object_name': 'FlaggedItem', 'db_table': "u'flagged_item'"},
357 'canceled': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
358 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
359 'flagged_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
360 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
361 'node': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'flaggeditems'", 'null': 'True', 'to': "orm['forum.Node']"}),
362 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {}),
363 'reason': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True'}),
364 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'flaggeditems'", 'to': "orm['forum.User']"})
367 'Meta': {'object_name': 'KeyValue'},
368 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
369 'key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}),
370 'value': ('forum.models.utils.PickledObjectField', [], {})
372 'forum.likedcomment': {
373 'Meta': {'object_name': 'LikedComment'},
374 'added_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
375 'canceled': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
376 'comment': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['forum.Comment']"}),
377 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
378 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['forum.User']"})
381 'Meta': {'object_name': 'MarkedTag'},
382 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
383 'reason': ('django.db.models.fields.CharField', [], {'max_length': '16'}),
384 'tag': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'user_selections'", 'to': "orm['forum.Tag']"}),
385 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'tag_selections'", 'to': "orm['forum.User']"})
388 'Meta': {'object_name': 'Node'},
389 'added_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
390 'author': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'nodes'", 'to': "orm['forum.User']"}),
391 'body': ('django.db.models.fields.TextField', [], {}),
392 'comment_count': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),
393 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
394 'deleted_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
395 'deleted_by': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'deleted_nodes'", 'null': 'True', 'to': "orm['forum.User']"}),
396 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
397 'last_edited_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
398 'last_edited_by': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'last_edited_nodes'", 'null': 'True', 'to': "orm['forum.User']"}),
399 'node_type': ('django.db.models.fields.CharField', [], {'default': "'node'", 'max_length': '16'}),
400 'offensive_flag_count': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}),
401 'parent': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'childs'", 'null': 'True', 'to': "orm['forum.Node']"}),
402 'score': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
403 'tagnames': ('django.db.models.fields.CharField', [], {'max_length': '125'}),
404 'tags': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'nodes'", 'to': "orm['forum.Tag']"}),
405 'title': ('django.db.models.fields.CharField', [], {'max_length': '300'}),
406 'vote_down_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
407 'vote_up_count': ('django.db.models.fields.IntegerField', [], {'default': '0'})
410 'Meta': {'object_name': 'Question', 'db_table': "u'question'"},
411 'added_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
412 'answer_accepted': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
413 'answer_count': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),
414 'author': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'questions'", 'to': "orm['forum.User']"}),
415 'close_reason': ('django.db.models.fields.SmallIntegerField', [], {'null': 'True', 'blank': 'True'}),
416 'closed': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
417 'closed_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
418 'closed_by': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'closed_questions'", 'null': 'True', 'to': "orm['forum.User']"}),
419 'comment_count': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),
420 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
421 'deleted_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
422 'deleted_by': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'deleted_questions'", 'null': 'True', 'to': "orm['forum.User']"}),
423 'favorited_by': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'favorite_questions'", 'through': "'FavoriteQuestion'", 'to': "orm['forum.User']"}),
424 'favourite_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
425 'followed_by': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'followed_questions'", 'to': "orm['forum.User']"}),
426 'html': ('django.db.models.fields.TextField', [], {}),
427 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
428 'last_activity_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
429 'last_activity_by': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'last_active_in_questions'", 'to': "orm['forum.User']"}),
430 'last_edited_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
431 'last_edited_by': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'last_edited_questions'", 'null': 'True', 'to': "orm['forum.User']"}),
432 'node_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['forum.Node']", 'unique': 'True', 'null': 'True'}),
433 'offensive_flag_count': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}),
434 'score': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
435 'subscribers': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'subscriptions'", 'through': "'QuestionSubscription'", 'to': "orm['forum.User']"}),
436 'summary': ('django.db.models.fields.CharField', [], {'max_length': '180'}),
437 'tagnames': ('django.db.models.fields.CharField', [], {'max_length': '125'}),
438 'tags': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'questions'", 'to': "orm['forum.Tag']"}),
439 'title': ('django.db.models.fields.CharField', [], {'max_length': '300'}),
440 'view_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
441 'vote_down_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
442 'vote_up_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
443 'wiki': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
444 'wikified_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'})
446 'forum.questionrevision': {
447 'Meta': {'object_name': 'QuestionRevision', 'db_table': "u'question_revision'"},
448 'author': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'questionrevisions'", 'to': "orm['forum.User']"}),
449 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
450 'question': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'revisions'", 'to': "orm['forum.Question']"}),
451 'revised_at': ('django.db.models.fields.DateTimeField', [], {}),
452 'revision': ('django.db.models.fields.PositiveIntegerField', [], {}),
453 'summary': ('django.db.models.fields.CharField', [], {'max_length': '300', 'blank': 'True'}),
454 'tagnames': ('django.db.models.fields.CharField', [], {'max_length': '125'}),
455 'text': ('django.db.models.fields.TextField', [], {}),
456 'title': ('django.db.models.fields.CharField', [], {'max_length': '300'})
458 'forum.questionsubscription': {
459 'Meta': {'object_name': 'QuestionSubscription'},
460 'auto_subscription': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
461 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
462 'last_view': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2010, 4, 14, 1, 29, 43, 727000)'}),
463 'question': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['forum.Question']"}),
464 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['forum.User']"})
467 'Meta': {'object_name': 'Repute', 'db_table': "u'repute'"},
468 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
469 'question': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['forum.Question']"}),
470 'reputation_type': ('django.db.models.fields.SmallIntegerField', [], {}),
471 'reputed_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
472 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'reputes'", 'to': "orm['forum.User']"}),
473 'user_previous_rep': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
474 'value': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'})
476 'forum.subscriptionsettings': {
477 'Meta': {'object_name': 'SubscriptionSettings'},
478 'all_questions': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
479 'all_questions_watched_tags': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
480 'enable_notifications': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
481 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
482 'member_joins': ('django.db.models.fields.CharField', [], {'default': "'n'", 'max_length': '1'}),
483 'new_question': ('django.db.models.fields.CharField', [], {'default': "'d'", 'max_length': '1'}),
484 'new_question_watched_tags': ('django.db.models.fields.CharField', [], {'default': "'i'", 'max_length': '1'}),
485 'notify_accepted': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
486 'notify_answers': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
487 'notify_comments': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
488 'notify_comments_own_post': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
489 'notify_reply_to_comments': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
490 'questions_answered': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
491 'questions_asked': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
492 'questions_commented': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
493 'questions_viewed': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
494 'subscribed_questions': ('django.db.models.fields.CharField', [], {'default': "'i'", 'max_length': '1'}),
495 'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'subscription_settings'", 'unique': 'True', 'to': "orm['forum.User']"})
498 'Meta': {'object_name': 'Tag', 'db_table': "u'tag'"},
499 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'created_tags'", 'to': "orm['forum.User']"}),
500 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
501 'deleted_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
502 'deleted_by': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'deleted_tags'", 'null': 'True', 'to': "orm['forum.User']"}),
503 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
504 'marked_by': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'marked_tags'", 'through': "'MarkedTag'", 'to': "orm['forum.User']"}),
505 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}),
506 'used_count': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'})
509 'Meta': {'object_name': 'User', '_ormbases': ['auth.User']},
510 'about': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
511 'bronze': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}),
512 'date_of_birth': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
513 'email_isvalid': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
514 'email_key': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}),
515 'gold': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}),
516 'hide_ignored_questions': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
517 'is_approved': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
518 'last_seen': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
519 'location': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
520 'questions_per_page': ('django.db.models.fields.SmallIntegerField', [], {'default': '10'}),
521 'real_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
522 'reputation': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1'}),
523 'silver': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}),
524 'user_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True', 'primary_key': 'True'}),
525 'website': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'})
527 'forum.validationhash': {
528 'Meta': {'unique_together': "(('user', 'type'),)", 'object_name': 'ValidationHash'},
529 'expiration': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2010, 4, 15, 1, 29, 43, 815000)'}),
530 'hash_code': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}),
531 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
532 'seed': ('django.db.models.fields.CharField', [], {'max_length': '12'}),
533 'type': ('django.db.models.fields.CharField', [], {'max_length': '12'}),
534 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['forum.User']"})
537 'Meta': {'object_name': 'Vote', 'db_table': "u'vote'"},
538 'canceled': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
539 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
540 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
541 'node': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'votes'", 'null': 'True', 'to': "orm['forum.Node']"}),
542 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {}),
543 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'votes'", 'to': "orm['forum.User']"}),
544 'vote': ('django.db.models.fields.SmallIntegerField', [], {}),
545 'voted_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'})
549 complete_apps = ['forum']