-# encoding: utf-8\r
-import datetime\r
-from south.db import db\r
-from south.v2 import DataMigration\r
-from django.db import models\r
-from forum.migrations import ProgressBar\r
-\r
-class Migration(DataMigration):\r
- \r
- def forwards(self, orm):\r
- #Converting questions\r
- question_count = orm.Question.objects.all().count()\r
- print "\nConverting %d questions:" % question_count\r
- progress = ProgressBar(question_count)\r
-\r
- question_id_map = {}\r
-\r
- for q in orm.Question.objects.order_by('id'):\r
- node = orm.Node(\r
- node_type='question',\r
- author=q.author,\r
- added_at=q.added_at,\r
- score=q.score,\r
- vote_up_count=q.vote_up_count,\r
- vote_down_count=q.vote_down_count,\r
- offensive_flag_count=q.offensive_flag_count,\r
- last_edited_at=q.last_edited_at,\r
- last_edited_by=q.last_edited_by,\r
- title=q.title,\r
- body=q.html,\r
- deleted=q.deleted,\r
- deleted_by=q.deleted_by,\r
- deleted_at=q.deleted_at,\r
- tagnames=q.tagnames,\r
- comment_count=q.comment_count,\r
- )\r
-\r
- node.save()\r
- q.node_ptr = node\r
- q.save()\r
- node.tags = q.tags.all()\r
-\r
- question_id_map[q.id] = node\r
- progress.update()\r
-\r
- print "\n...done\n"\r
-\r
- #Converting answers\r
- answer_count = orm.Answer.objects.all().count()\r
- print "Converting %d answers:" % answer_count\r
- progress = ProgressBar(answer_count)\r
-\r
- answer_id_map = {}\r
-\r
- for a in orm.Answer.objects.order_by('id'):\r
- node = orm.Node(\r
- node_type='answer',\r
- parent=question_id_map[a.question.id],\r
- author=a.author,\r
- added_at=a.added_at,\r
- score=a.score,\r
- vote_up_count=a.vote_up_count,\r
- vote_down_count=a.vote_down_count,\r
- offensive_flag_count=a.offensive_flag_count,\r
- last_edited_at=a.last_edited_at,\r
- last_edited_by=a.last_edited_by,\r
- body=a.html,\r
- deleted=a.deleted,\r
- deleted_by=a.deleted_by,\r
- deleted_at=a.deleted_at,\r
- comment_count=a.comment_count,\r
- )\r
-\r
- node.save()\r
- a.node_ptr = node\r
- a.save()\r
- answer_id_map[a.id] = node\r
- progress.update()\r
-\r
- print "\n...done\n"\r
-\r
- ctypes = dict([(ct.name, ct.id) for ct in orm['contenttypes.ContentType'].objects.all()])\r
-\r
- #Converting votes\r
- vote_count = orm.Vote.objects.all().count()\r
- print "Converting %d vote references:" % vote_count\r
- progress = ProgressBar(vote_count)\r
- orfan_count = 0\r
-\r
- for v in orm.Vote.objects.all():\r
- node = (v.content_type.id == ctypes['question']) and question_id_map.get(v.object_id, None) \\r
- or answer_id_map.get(v.object_id, None)\r
-\r
- if node:\r
- v.node = node\r
- v.save()\r
- else:\r
- v.delete()\r
- orfan_count += 1\r
-\r
- progress.update()\r
-\r
- if orfan_count:\r
- print "Deleted %d orfan votes"\r
-\r
- print "\n...done\n"\r
-\r
- #Converting flags\r
- flag_count = orm.FlaggedItem.objects.all().count()\r
- print "Converting %d flag references:" % flag_count\r
- progress = ProgressBar(flag_count)\r
- orfan_count = 0\r
-\r
- for f in orm.FlaggedItem.objects.all():\r
- node = (f.content_type.id == ctypes['question']) and question_id_map.get(f.object_id, None) \\r
- or answer_id_map.get(f.object_id, None)\r
-\r
- if node:\r
- f.node = node\r
- f.save()\r
- else:\r
- f.delete()\r
- orfan_count += 1\r
-\r
- progress.update()\r
-\r
- if orfan_count:\r
- print "Deleted %d orfan votes"\r
-\r
- print "\n...done\n"\r
-\r
- #Converting comments\r
- comment_count = orm.Comment.objects.all().count()\r
- print "Converting %d comment references:" % comment_count\r
- progress = ProgressBar(comment_count)\r
- orfan_count = 0\r
-\r
- for c in orm.Comment.objects.all():\r
- node = (c.content_type.id == ctypes['question']) and question_id_map.get(c.object_id, None) \\r
- or answer_id_map.get(c.object_id, None)\r
-\r
- if node:\r
- c.node = node\r
- c.save()\r
- else:\r
- c.delete()\r
- orfan_count += 1\r
-\r
- progress.update()\r
-\r
- if orfan_count:\r
- print "Deleted %d orfan comments"\r
-\r
- print "\n...done\n"\r
-\r
-\r
- #Converting awards\r
- awards = orm.Award.objects.filter(content_type__id__in=(ctypes['question'], ctypes['answer']))\r
- award_count = awards.count()\r
- print "Converting %d award references:" % award_count\r
- progress = ProgressBar(award_count)\r
-\r
- for a in awards:\r
- node = (a.content_type.id == ctypes['question']) and question_id_map.get(a.object_id, None) \\r
- or answer_id_map.get(a.object_id, None)\r
-\r
- if node:\r
- a.object_id = node.id\r
- a.save()\r
-\r
- progress.update()\r
-\r
- print "\n...done\n"\r
-\r
-\r
- #Converting activity\r
- activities = orm.Activity.objects.filter(content_type__id__in=(ctypes['question'], ctypes['answer']))\r
- activity_count = activities.count()\r
- print "Converting %d activity references:" % activity_count\r
- progress = ProgressBar(activity_count)\r
-\r
- for a in activities:\r
- node = (a.content_type.id == ctypes['question']) and question_id_map.get(a.object_id, None) \\r
- or answer_id_map.get(a.object_id, None)\r
-\r
- if node:\r
- a.object_id = node.id\r
- a.save()\r
-\r
- progress.update()\r
-\r
- print "\n...done\n"\r
- \r
- \r
- def backwards(self, orm):\r
- "Write your backwards methods here."\r
- \r
- models = {\r
- 'auth.group': {\r
- 'Meta': {'object_name': 'Group'},\r
- 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\r
- 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),\r
- 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'blank': 'True'})\r
- },\r
- 'auth.permission': {\r
- 'Meta': {'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},\r
- 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),\r
- 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),\r
- 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\r
- 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})\r
- },\r
- 'auth.user': {\r
- 'Meta': {'object_name': 'User'},\r
- 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),\r
- 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),\r
- 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),\r
- 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'blank': 'True'}),\r
- 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\r
- 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),\r
- 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),\r
- 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),\r
- 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),\r
- 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),\r
- 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),\r
- 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'blank': 'True'}),\r
- 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})\r
- },\r
- 'contenttypes.contenttype': {\r
- 'Meta': {'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},\r
- 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),\r
- 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\r
- 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),\r
- 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})\r
- },\r
- 'forum.activity': {\r
- 'Meta': {'object_name': 'Activity', 'db_table': "u'activity'"},\r
- 'active_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),\r
- 'activity_type': ('django.db.models.fields.SmallIntegerField', [], {}),\r
- 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),\r
- 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\r
- 'is_auditted': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),\r
- 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {}),\r
- 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['forum.User']"})\r
- },\r
- 'forum.anonymousanswer': {\r
- 'Meta': {'object_name': 'AnonymousAnswer'},\r
- 'added_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),\r
- 'author': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['forum.User']", 'null': 'True'}),\r
- 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\r
- 'ip_addr': ('django.db.models.fields.IPAddressField', [], {'max_length': '15'}),\r
- 'question': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'anonymous_answers'", 'to': "orm['forum.Question']"}),\r
- 'session_key': ('django.db.models.fields.CharField', [], {'max_length': '40'}),\r
- 'summary': ('django.db.models.fields.CharField', [], {'max_length': '180'}),\r
- 'text': ('django.db.models.fields.TextField', [], {}),\r
- 'wiki': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'})\r
- },\r
- 'forum.anonymousquestion': {\r
- 'Meta': {'object_name': 'AnonymousQuestion'},\r
- 'added_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),\r
- 'author': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['forum.User']", 'null': 'True'}),\r
- 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\r
- 'ip_addr': ('django.db.models.fields.IPAddressField', [], {'max_length': '15'}),\r
- 'session_key': ('django.db.models.fields.CharField', [], {'max_length': '40'}),\r
- 'summary': ('django.db.models.fields.CharField', [], {'max_length': '180'}),\r
- 'tagnames': ('django.db.models.fields.CharField', [], {'max_length': '125'}),\r
- 'text': ('django.db.models.fields.TextField', [], {}),\r
- 'title': ('django.db.models.fields.CharField', [], {'max_length': '300'}),\r
- 'wiki': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'})\r
- },\r
- 'forum.answer': {\r
- 'Meta': {'object_name': 'Answer', 'db_table': "u'answer'"},\r
- 'accepted': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),\r
- 'accepted_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),\r
- 'accepted_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['forum.User']", 'null': 'True'}),\r
- 'added_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),\r
- 'author': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'answers'", 'to': "orm['forum.User']"}),\r
- 'comment_count': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),\r
- 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),\r
- 'deleted_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),\r
- 'deleted_by': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'deleted_answers'", 'null': 'True', 'to': "orm['forum.User']"}),\r
- 'html': ('django.db.models.fields.TextField', [], {}),\r
- 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\r
- 'last_edited_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),\r
- 'last_edited_by': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'last_edited_answers'", 'null': 'True', 'to': "orm['forum.User']"}),\r
- 'node_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['forum.Node']", 'unique': 'True', 'null': 'True'}),\r
- 'offensive_flag_count': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}),\r
- 'question': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'answers'", 'to': "orm['forum.Question']"}),\r
- 'score': ('django.db.models.fields.IntegerField', [], {'default': '0'}),\r
- 'vote_down_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}),\r
- 'vote_up_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}),\r
- 'wiki': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),\r
- 'wikified_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'})\r
- },\r
- 'forum.answerrevision': {\r
- 'Meta': {'object_name': 'AnswerRevision', 'db_table': "u'answer_revision'"},\r
- 'answer': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'revisions'", 'to': "orm['forum.Answer']"}),\r
- 'author': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'answerrevisions'", 'to': "orm['forum.User']"}),\r
- 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\r
- 'revised_at': ('django.db.models.fields.DateTimeField', [], {}),\r
- 'revision': ('django.db.models.fields.PositiveIntegerField', [], {}),\r
- 'summary': ('django.db.models.fields.CharField', [], {'max_length': '300', 'blank': 'True'}),\r
- 'text': ('django.db.models.fields.TextField', [], {})\r
- },\r
- 'forum.authkeyuserassociation': {\r
- 'Meta': {'object_name': 'AuthKeyUserAssociation'},\r
- 'added_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),\r
- 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\r
- 'key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}),\r
- 'provider': ('django.db.models.fields.CharField', [], {'max_length': '64'}),\r
- 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'auth_keys'", 'to': "orm['forum.User']"})\r
- },\r
- 'forum.award': {\r
- 'Meta': {'unique_together': "(('content_type', 'object_id', 'user', 'badge'),)", 'object_name': 'Award', 'db_table': "u'award'"},\r
- 'awarded_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),\r
- 'badge': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'award_badge'", 'to': "orm['forum.Badge']"}),\r
- 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),\r
- 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\r
- 'notified': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),\r
- 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {}),\r
- 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'awards'", 'to': "orm['forum.User']"})\r
- },\r
- 'forum.badge': {\r
- 'Meta': {'unique_together': "(('name', 'type'),)", 'object_name': 'Badge', 'db_table': "u'badge'"},\r
- 'awarded_count': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),\r
- 'awarded_to': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'badges'", 'through': "'Award'", 'to': "orm['forum.User']"}),\r
- 'description': ('django.db.models.fields.CharField', [], {'max_length': '300'}),\r
- 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\r
- 'multiple': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),\r
- 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}),\r
- 'slug': ('django.db.models.fields.SlugField', [], {'db_index': 'True', 'max_length': '50', 'blank': 'True'}),\r
- 'type': ('django.db.models.fields.SmallIntegerField', [], {})\r
- },\r
- 'forum.comment': {\r
- 'Meta': {'object_name': 'Comment', 'db_table': "u'comment'"},\r
- 'added_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),\r
- 'comment': ('django.db.models.fields.CharField', [], {'max_length': '300'}),\r
- 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),\r
- 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),\r
- 'deleted_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),\r
- 'deleted_by': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'deleted_comments'", 'null': 'True', 'to': "orm['forum.User']"}),\r
- 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\r
- 'liked_by': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'comments_liked'", 'through': "'LikedComment'", 'to': "orm['forum.User']"}),\r
- 'node': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'comments'", 'null': 'True', 'to': "orm['forum.Node']"}),\r
- 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {}),\r
- 'score': ('django.db.models.fields.IntegerField', [], {'default': '0'}),\r
- 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'comments'", 'to': "orm['forum.User']"})\r
- },\r
- 'forum.favoritequestion': {\r
- 'Meta': {'unique_together': "(('question', 'user'),)", 'object_name': 'FavoriteQuestion', 'db_table': "u'favorite_question'"},\r
- 'added_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),\r
- 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\r
- 'question': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['forum.Question']"}),\r
- 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'user_favorite_questions'", 'to': "orm['forum.User']"})\r
- },\r
- 'forum.flaggeditem': {\r
- 'Meta': {'object_name': 'FlaggedItem', 'db_table': "u'flagged_item'"},\r
- 'canceled': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),\r
- 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),\r
- 'flagged_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),\r
- 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\r
- 'node': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'flaggeditems'", 'null': 'True', 'to': "orm['forum.Node']"}),\r
- 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {}),\r
- 'reason': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True'}),\r
- 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'flaggeditems'", 'to': "orm['forum.User']"})\r
- },\r
- 'forum.keyvalue': {\r
- 'Meta': {'object_name': 'KeyValue'},\r
- 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\r
- 'key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}),\r
- 'value': ('forum.models.utils.PickledObjectField', [], {})\r
- },\r
- 'forum.likedcomment': {\r
- 'Meta': {'object_name': 'LikedComment'},\r
- 'added_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),\r
- 'canceled': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),\r
- 'comment': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['forum.Comment']"}),\r
- 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\r
- 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['forum.User']"})\r
- },\r
- 'forum.markedtag': {\r
- 'Meta': {'object_name': 'MarkedTag'},\r
- 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\r
- 'reason': ('django.db.models.fields.CharField', [], {'max_length': '16'}),\r
- 'tag': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'user_selections'", 'to': "orm['forum.Tag']"}),\r
- 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'tag_selections'", 'to': "orm['forum.User']"})\r
- },\r
- 'forum.node': {\r
- 'Meta': {'object_name': 'Node'},\r
- 'added_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),\r
- 'author': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'nodes'", 'to': "orm['forum.User']"}),\r
- 'body': ('django.db.models.fields.TextField', [], {}),\r
- 'comment_count': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),\r
- 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),\r
- 'deleted_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),\r
- 'deleted_by': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'deleted_nodes'", 'null': 'True', 'to': "orm['forum.User']"}),\r
- 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\r
- 'last_edited_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),\r
- 'last_edited_by': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'last_edited_nodes'", 'null': 'True', 'to': "orm['forum.User']"}),\r
- 'node_type': ('django.db.models.fields.CharField', [], {'default': "'node'", 'max_length': '16'}),\r
- 'offensive_flag_count': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}),\r
- 'parent': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'childs'", 'null': 'True', 'to': "orm['forum.Node']"}),\r
- 'score': ('django.db.models.fields.IntegerField', [], {'default': '0'}),\r
- 'tagnames': ('django.db.models.fields.CharField', [], {'max_length': '125'}),\r
- 'tags': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'nodes'", 'to': "orm['forum.Tag']"}),\r
- 'title': ('django.db.models.fields.CharField', [], {'max_length': '300'}),\r
- 'vote_down_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}),\r
- 'vote_up_count': ('django.db.models.fields.IntegerField', [], {'default': '0'})\r
- },\r
- 'forum.question': {\r
- 'Meta': {'object_name': 'Question', 'db_table': "u'question'"},\r
- 'added_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),\r
- 'answer_accepted': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),\r
- 'answer_count': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),\r
- 'author': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'questions'", 'to': "orm['forum.User']"}),\r
- 'close_reason': ('django.db.models.fields.SmallIntegerField', [], {'null': 'True', 'blank': 'True'}),\r
- 'closed': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),\r
- 'closed_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),\r
- 'closed_by': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'closed_questions'", 'null': 'True', 'to': "orm['forum.User']"}),\r
- 'comment_count': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),\r
- 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),\r
- 'deleted_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),\r
- 'deleted_by': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'deleted_questions'", 'null': 'True', 'to': "orm['forum.User']"}),\r
- 'favorited_by': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'favorite_questions'", 'through': "'FavoriteQuestion'", 'to': "orm['forum.User']"}),\r
- 'favourite_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}),\r
- 'followed_by': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'followed_questions'", 'to': "orm['forum.User']"}),\r
- 'html': ('django.db.models.fields.TextField', [], {}),\r
- 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\r
- 'last_activity_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),\r
- 'last_activity_by': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'last_active_in_questions'", 'to': "orm['forum.User']"}),\r
- 'last_edited_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),\r
- 'last_edited_by': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'last_edited_questions'", 'null': 'True', 'to': "orm['forum.User']"}),\r
- 'node_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['forum.Node']", 'unique': 'True', 'null': 'True'}),\r
- 'offensive_flag_count': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}),\r
- 'score': ('django.db.models.fields.IntegerField', [], {'default': '0'}),\r
- 'subscribers': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'subscriptions'", 'through': "'QuestionSubscription'", 'to': "orm['forum.User']"}),\r
- 'summary': ('django.db.models.fields.CharField', [], {'max_length': '180'}),\r
- 'tagnames': ('django.db.models.fields.CharField', [], {'max_length': '125'}),\r
- 'tags': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'questions'", 'to': "orm['forum.Tag']"}),\r
- 'title': ('django.db.models.fields.CharField', [], {'max_length': '300'}),\r
- 'view_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}),\r
- 'vote_down_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}),\r
- 'vote_up_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}),\r
- 'wiki': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),\r
- 'wikified_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'})\r
- },\r
- 'forum.questionrevision': {\r
- 'Meta': {'object_name': 'QuestionRevision', 'db_table': "u'question_revision'"},\r
- 'author': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'questionrevisions'", 'to': "orm['forum.User']"}),\r
- 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\r
- 'question': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'revisions'", 'to': "orm['forum.Question']"}),\r
- 'revised_at': ('django.db.models.fields.DateTimeField', [], {}),\r
- 'revision': ('django.db.models.fields.PositiveIntegerField', [], {}),\r
- 'summary': ('django.db.models.fields.CharField', [], {'max_length': '300', 'blank': 'True'}),\r
- 'tagnames': ('django.db.models.fields.CharField', [], {'max_length': '125'}),\r
- 'text': ('django.db.models.fields.TextField', [], {}),\r
- 'title': ('django.db.models.fields.CharField', [], {'max_length': '300'})\r
- },\r
- 'forum.questionsubscription': {\r
- 'Meta': {'object_name': 'QuestionSubscription'},\r
- 'auto_subscription': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),\r
- 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\r
- 'last_view': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2010, 4, 14, 1, 29, 43, 727000)'}),\r
- 'question': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['forum.Question']"}),\r
- 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['forum.User']"})\r
- },\r
- 'forum.repute': {\r
- 'Meta': {'object_name': 'Repute', 'db_table': "u'repute'"},\r
- 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\r
- 'question': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['forum.Question']"}),\r
- 'reputation_type': ('django.db.models.fields.SmallIntegerField', [], {}),\r
- 'reputed_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),\r
- 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'reputes'", 'to': "orm['forum.User']"}),\r
- 'user_previous_rep': ('django.db.models.fields.IntegerField', [], {'default': '0'}),\r
- 'value': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'})\r
- },\r
- 'forum.subscriptionsettings': {\r
- 'Meta': {'object_name': 'SubscriptionSettings'},\r
- 'all_questions': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),\r
- 'all_questions_watched_tags': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),\r
- 'enable_notifications': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),\r
- 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\r
- 'member_joins': ('django.db.models.fields.CharField', [], {'default': "'n'", 'max_length': '1'}),\r
- 'new_question': ('django.db.models.fields.CharField', [], {'default': "'d'", 'max_length': '1'}),\r
- 'new_question_watched_tags': ('django.db.models.fields.CharField', [], {'default': "'i'", 'max_length': '1'}),\r
- 'notify_accepted': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),\r
- 'notify_answers': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),\r
- 'notify_comments': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),\r
- 'notify_comments_own_post': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),\r
- 'notify_reply_to_comments': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),\r
- 'questions_answered': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),\r
- 'questions_asked': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),\r
- 'questions_commented': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),\r
- 'questions_viewed': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),\r
- 'subscribed_questions': ('django.db.models.fields.CharField', [], {'default': "'i'", 'max_length': '1'}),\r
- 'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'subscription_settings'", 'unique': 'True', 'to': "orm['forum.User']"})\r
- },\r
- 'forum.tag': {\r
- 'Meta': {'object_name': 'Tag', 'db_table': "u'tag'"},\r
- 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'created_tags'", 'to': "orm['forum.User']"}),\r
- 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),\r
- 'deleted_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),\r
- 'deleted_by': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'deleted_tags'", 'null': 'True', 'to': "orm['forum.User']"}),\r
- 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\r
- 'marked_by': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'marked_tags'", 'through': "'MarkedTag'", 'to': "orm['forum.User']"}),\r
- 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}),\r
- 'used_count': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'})\r
- },\r
- 'forum.user': {\r
- 'Meta': {'object_name': 'User', '_ormbases': ['auth.User']},\r
- 'about': ('django.db.models.fields.TextField', [], {'blank': 'True'}),\r
- 'bronze': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}),\r
- 'date_of_birth': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),\r
- 'email_isvalid': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),\r
- 'email_key': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}),\r
- 'gold': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}),\r
- 'hide_ignored_questions': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),\r
- 'is_approved': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),\r
- 'last_seen': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),\r
- 'location': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),\r
- 'questions_per_page': ('django.db.models.fields.SmallIntegerField', [], {'default': '10'}),\r
- 'real_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),\r
- 'reputation': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1'}),\r
- 'silver': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}),\r
- 'user_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True', 'primary_key': 'True'}),\r
- 'website': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'})\r
- },\r
- 'forum.validationhash': {\r
- 'Meta': {'unique_together': "(('user', 'type'),)", 'object_name': 'ValidationHash'},\r
- 'expiration': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2010, 4, 15, 1, 29, 43, 815000)'}),\r
- 'hash_code': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}),\r
- 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\r
- 'seed': ('django.db.models.fields.CharField', [], {'max_length': '12'}),\r
- 'type': ('django.db.models.fields.CharField', [], {'max_length': '12'}),\r
- 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['forum.User']"})\r
- },\r
- 'forum.vote': {\r
- 'Meta': {'object_name': 'Vote', 'db_table': "u'vote'"},\r
- 'canceled': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),\r
- 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),\r
- 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\r
- 'node': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'votes'", 'null': 'True', 'to': "orm['forum.Node']"}),\r
- 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {}),\r
- 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'votes'", 'to': "orm['forum.User']"}),\r
- 'vote': ('django.db.models.fields.SmallIntegerField', [], {}),\r
- 'voted_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'})\r
- }\r
- }\r
- \r
- complete_apps = ['forum']\r
+# encoding: utf-8
+import datetime
+from south.db import db
+from south.v2 import DataMigration
+from django.db import models
+from forum.migrations import ProgressBar
+
+class Migration(DataMigration):
+
+ def forwards(self, orm):
+ #Converting questions
+ question_count = orm.Question.objects.all().count()
+ print "\nConverting %d questions:" % question_count
+ progress = ProgressBar(question_count)
+
+ question_id_map = {}
+
+ for q in orm.Question.objects.order_by('id'):
+ node = orm.Node(
+ node_type='question',
+ author=q.author,
+ added_at=q.added_at,
+ score=q.score,
+ vote_up_count=q.vote_up_count,
+ vote_down_count=q.vote_down_count,
+ offensive_flag_count=q.offensive_flag_count,
+ last_edited_at=q.last_edited_at,
+ last_edited_by=q.last_edited_by,
+ title=q.title,
+ body=q.html,
+ deleted=q.deleted,
+ deleted_by=q.deleted_by,
+ deleted_at=q.deleted_at,
+ tagnames=q.tagnames,
+ comment_count=q.comment_count,
+ )
+
+ node.save()
+ q.node_ptr = node
+ q.save()
+ node.tags = q.tags.all()
+
+ question_id_map[q.id] = node
+ progress.update()
+
+ print "\n...done\n"
+
+ #Converting answers
+ answer_count = orm.Answer.objects.all().count()
+ print "Converting %d answers:" % answer_count
+ progress = ProgressBar(answer_count)
+
+ answer_id_map = {}
+
+ for a in orm.Answer.objects.order_by('id'):
+ node = orm.Node(
+ node_type='answer',
+ parent=question_id_map[a.question.id],
+ author=a.author,
+ added_at=a.added_at,
+ score=a.score,
+ vote_up_count=a.vote_up_count,
+ vote_down_count=a.vote_down_count,
+ offensive_flag_count=a.offensive_flag_count,
+ last_edited_at=a.last_edited_at,
+ last_edited_by=a.last_edited_by,
+ body=a.html,
+ deleted=a.deleted,
+ deleted_by=a.deleted_by,
+ deleted_at=a.deleted_at,
+ comment_count=a.comment_count,
+ )
+
+ node.save()
+ a.node_ptr = node
+ a.save()
+ answer_id_map[a.id] = node
+ progress.update()
+
+ print "\n...done\n"
+
+ ctypes = dict([(ct.name, ct.id) for ct in orm['contenttypes.ContentType'].objects.all()])
+
+ #Converting votes
+ vote_count = orm.Vote.objects.all().count()
+ print "Converting %d vote references:" % vote_count
+ progress = ProgressBar(vote_count)
+ orfan_count = 0
+
+ for v in orm.Vote.objects.all():
+ node = (v.content_type.id == ctypes['question']) and question_id_map.get(v.object_id, None) \
+ or answer_id_map.get(v.object_id, None)
+
+ if node:
+ v.node = node
+ v.save()
+ else:
+ v.delete()
+ orfan_count += 1
+
+ progress.update()
+
+ if orfan_count:
+ print "Deleted %d orfan votes"
+
+ print "\n...done\n"
+
+ #Converting flags
+ flag_count = orm.FlaggedItem.objects.all().count()
+ print "Converting %d flag references:" % flag_count
+ progress = ProgressBar(flag_count)
+ orfan_count = 0
+
+ for f in orm.FlaggedItem.objects.all():
+ node = (f.content_type.id == ctypes['question']) and question_id_map.get(f.object_id, None) \
+ or answer_id_map.get(f.object_id, None)
+
+ if node:
+ f.node = node
+ f.save()
+ else:
+ f.delete()
+ orfan_count += 1
+
+ progress.update()
+
+ if orfan_count:
+ print "Deleted %d orfan votes"
+
+ print "\n...done\n"
+
+ #Converting comments
+ comment_count = orm.Comment.objects.all().count()
+ print "Converting %d comment references:" % comment_count
+ progress = ProgressBar(comment_count)
+ orfan_count = 0
+
+ for c in orm.Comment.objects.all():
+ node = (c.content_type.id == ctypes['question']) and question_id_map.get(c.object_id, None) \
+ or answer_id_map.get(c.object_id, None)
+
+ if node:
+ c.node = node
+ c.save()
+ else:
+ c.delete()
+ orfan_count += 1
+
+ progress.update()
+
+ if orfan_count:
+ print "Deleted %d orfan comments"
+
+ print "\n...done\n"
+
+
+ #Converting awards
+ awards = orm.Award.objects.filter(content_type__id__in=(ctypes['question'], ctypes['answer']))
+ award_count = awards.count()
+ print "Converting %d award references:" % award_count
+ progress = ProgressBar(award_count)
+
+ for a in awards:
+ node = (a.content_type.id == ctypes['question']) and question_id_map.get(a.object_id, None) \
+ or answer_id_map.get(a.object_id, None)
+
+ if node:
+ a.object_id = node.id
+ a.save()
+
+ progress.update()
+
+ print "\n...done\n"
+
+
+ #Converting activity
+ activities = orm.Activity.objects.filter(content_type__id__in=(ctypes['question'], ctypes['answer']))
+ activity_count = activities.count()
+ print "Converting %d activity references:" % activity_count
+ progress = ProgressBar(activity_count)
+
+ for a in activities:
+ node = (a.content_type.id == ctypes['question']) and question_id_map.get(a.object_id, None) \
+ or answer_id_map.get(a.object_id, None)
+
+ if node:
+ a.object_id = node.id
+ a.save()
+
+ progress.update()
+
+ print "\n...done\n"
+
+
+ def backwards(self, orm):
+ "Write your backwards methods here."
+
+ models = {
+ 'auth.group': {
+ 'Meta': {'object_name': 'Group'},
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
+ 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'blank': 'True'})
+ },
+ 'auth.permission': {
+ 'Meta': {'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
+ 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
+ },
+ 'auth.user': {
+ 'Meta': {'object_name': 'User'},
+ 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
+ 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
+ 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
+ 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
+ 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
+ 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
+ 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
+ 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
+ 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
+ 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'blank': 'True'}),
+ 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
+ },
+ 'contenttypes.contenttype': {
+ 'Meta': {'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
+ 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
+ },
+ 'forum.activity': {
+ 'Meta': {'object_name': 'Activity', 'db_table': "u'activity'"},
+ 'active_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
+ 'activity_type': ('django.db.models.fields.SmallIntegerField', [], {}),
+ 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'is_auditted': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
+ 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {}),
+ 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['forum.User']"})
+ },
+ 'forum.anonymousanswer': {
+ 'Meta': {'object_name': 'AnonymousAnswer'},
+ 'added_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
+ 'author': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['forum.User']", 'null': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'ip_addr': ('django.db.models.fields.IPAddressField', [], {'max_length': '15'}),
+ 'question': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'anonymous_answers'", 'to': "orm['forum.Question']"}),
+ 'session_key': ('django.db.models.fields.CharField', [], {'max_length': '40'}),
+ 'summary': ('django.db.models.fields.CharField', [], {'max_length': '180'}),
+ 'text': ('django.db.models.fields.TextField', [], {}),
+ 'wiki': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'})
+ },
+ 'forum.anonymousquestion': {
+ 'Meta': {'object_name': 'AnonymousQuestion'},
+ 'added_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
+ 'author': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['forum.User']", 'null': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'ip_addr': ('django.db.models.fields.IPAddressField', [], {'max_length': '15'}),
+ 'session_key': ('django.db.models.fields.CharField', [], {'max_length': '40'}),
+ 'summary': ('django.db.models.fields.CharField', [], {'max_length': '180'}),
+ 'tagnames': ('django.db.models.fields.CharField', [], {'max_length': '125'}),
+ 'text': ('django.db.models.fields.TextField', [], {}),
+ 'title': ('django.db.models.fields.CharField', [], {'max_length': '300'}),
+ 'wiki': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'})
+ },
+ 'forum.answer': {
+ 'Meta': {'object_name': 'Answer', 'db_table': "u'answer'"},
+ 'accepted': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
+ 'accepted_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
+ 'accepted_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['forum.User']", 'null': 'True'}),
+ 'added_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
+ 'author': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'answers'", 'to': "orm['forum.User']"}),
+ 'comment_count': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),
+ 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
+ 'deleted_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
+ 'deleted_by': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'deleted_answers'", 'null': 'True', 'to': "orm['forum.User']"}),
+ 'html': ('django.db.models.fields.TextField', [], {}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'last_edited_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
+ 'last_edited_by': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'last_edited_answers'", 'null': 'True', 'to': "orm['forum.User']"}),
+ 'node_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['forum.Node']", 'unique': 'True', 'null': 'True'}),
+ 'offensive_flag_count': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}),
+ 'question': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'answers'", 'to': "orm['forum.Question']"}),
+ 'score': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
+ 'vote_down_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
+ 'vote_up_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
+ 'wiki': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
+ 'wikified_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'})
+ },
+ 'forum.answerrevision': {
+ 'Meta': {'object_name': 'AnswerRevision', 'db_table': "u'answer_revision'"},
+ 'answer': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'revisions'", 'to': "orm['forum.Answer']"}),
+ 'author': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'answerrevisions'", 'to': "orm['forum.User']"}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'revised_at': ('django.db.models.fields.DateTimeField', [], {}),
+ 'revision': ('django.db.models.fields.PositiveIntegerField', [], {}),
+ 'summary': ('django.db.models.fields.CharField', [], {'max_length': '300', 'blank': 'True'}),
+ 'text': ('django.db.models.fields.TextField', [], {})
+ },
+ 'forum.authkeyuserassociation': {
+ 'Meta': {'object_name': 'AuthKeyUserAssociation'},
+ 'added_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}),
+ 'provider': ('django.db.models.fields.CharField', [], {'max_length': '64'}),
+ 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'auth_keys'", 'to': "orm['forum.User']"})
+ },
+ 'forum.award': {
+ 'Meta': {'unique_together': "(('content_type', 'object_id', 'user', 'badge'),)", 'object_name': 'Award', 'db_table': "u'award'"},
+ 'awarded_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
+ 'badge': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'award_badge'", 'to': "orm['forum.Badge']"}),
+ 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'notified': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
+ 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {}),
+ 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'awards'", 'to': "orm['forum.User']"})
+ },
+ 'forum.badge': {
+ 'Meta': {'unique_together': "(('name', 'type'),)", 'object_name': 'Badge', 'db_table': "u'badge'"},
+ 'awarded_count': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),
+ 'awarded_to': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'badges'", 'through': "'Award'", 'to': "orm['forum.User']"}),
+ 'description': ('django.db.models.fields.CharField', [], {'max_length': '300'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'multiple': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
+ 'slug': ('django.db.models.fields.SlugField', [], {'db_index': 'True', 'max_length': '50', 'blank': 'True'}),
+ 'type': ('django.db.models.fields.SmallIntegerField', [], {})
+ },
+ 'forum.comment': {
+ 'Meta': {'object_name': 'Comment', 'db_table': "u'comment'"},
+ 'added_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
+ 'comment': ('django.db.models.fields.CharField', [], {'max_length': '300'}),
+ 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
+ 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
+ 'deleted_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
+ 'deleted_by': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'deleted_comments'", 'null': 'True', 'to': "orm['forum.User']"}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'liked_by': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'comments_liked'", 'through': "'LikedComment'", 'to': "orm['forum.User']"}),
+ 'node': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'comments'", 'null': 'True', 'to': "orm['forum.Node']"}),
+ 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {}),
+ 'score': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
+ 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'comments'", 'to': "orm['forum.User']"})
+ },
+ 'forum.favoritequestion': {
+ 'Meta': {'unique_together': "(('question', 'user'),)", 'object_name': 'FavoriteQuestion', 'db_table': "u'favorite_question'"},
+ 'added_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'question': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['forum.Question']"}),
+ 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'user_favorite_questions'", 'to': "orm['forum.User']"})
+ },
+ 'forum.flaggeditem': {
+ 'Meta': {'object_name': 'FlaggedItem', 'db_table': "u'flagged_item'"},
+ 'canceled': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
+ 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
+ 'flagged_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'node': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'flaggeditems'", 'null': 'True', 'to': "orm['forum.Node']"}),
+ 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {}),
+ 'reason': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True'}),
+ 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'flaggeditems'", 'to': "orm['forum.User']"})
+ },
+ 'forum.keyvalue': {
+ 'Meta': {'object_name': 'KeyValue'},
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}),
+ 'value': ('forum.models.utils.PickledObjectField', [], {})
+ },
+ 'forum.likedcomment': {
+ 'Meta': {'object_name': 'LikedComment'},
+ 'added_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
+ 'canceled': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
+ 'comment': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['forum.Comment']"}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['forum.User']"})
+ },
+ 'forum.markedtag': {
+ 'Meta': {'object_name': 'MarkedTag'},
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'reason': ('django.db.models.fields.CharField', [], {'max_length': '16'}),
+ 'tag': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'user_selections'", 'to': "orm['forum.Tag']"}),
+ 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'tag_selections'", 'to': "orm['forum.User']"})
+ },
+ 'forum.node': {
+ 'Meta': {'object_name': 'Node'},
+ 'added_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
+ 'author': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'nodes'", 'to': "orm['forum.User']"}),
+ 'body': ('django.db.models.fields.TextField', [], {}),
+ 'comment_count': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),
+ 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
+ 'deleted_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
+ 'deleted_by': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'deleted_nodes'", 'null': 'True', 'to': "orm['forum.User']"}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'last_edited_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
+ 'last_edited_by': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'last_edited_nodes'", 'null': 'True', 'to': "orm['forum.User']"}),
+ 'node_type': ('django.db.models.fields.CharField', [], {'default': "'node'", 'max_length': '16'}),
+ 'offensive_flag_count': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}),
+ 'parent': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'childs'", 'null': 'True', 'to': "orm['forum.Node']"}),
+ 'score': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
+ 'tagnames': ('django.db.models.fields.CharField', [], {'max_length': '125'}),
+ 'tags': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'nodes'", 'to': "orm['forum.Tag']"}),
+ 'title': ('django.db.models.fields.CharField', [], {'max_length': '300'}),
+ 'vote_down_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
+ 'vote_up_count': ('django.db.models.fields.IntegerField', [], {'default': '0'})
+ },
+ 'forum.question': {
+ 'Meta': {'object_name': 'Question', 'db_table': "u'question'"},
+ 'added_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
+ 'answer_accepted': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
+ 'answer_count': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),
+ 'author': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'questions'", 'to': "orm['forum.User']"}),
+ 'close_reason': ('django.db.models.fields.SmallIntegerField', [], {'null': 'True', 'blank': 'True'}),
+ 'closed': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
+ 'closed_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
+ 'closed_by': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'closed_questions'", 'null': 'True', 'to': "orm['forum.User']"}),
+ 'comment_count': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),
+ 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
+ 'deleted_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
+ 'deleted_by': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'deleted_questions'", 'null': 'True', 'to': "orm['forum.User']"}),
+ 'favorited_by': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'favorite_questions'", 'through': "'FavoriteQuestion'", 'to': "orm['forum.User']"}),
+ 'favourite_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
+ 'followed_by': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'followed_questions'", 'to': "orm['forum.User']"}),
+ 'html': ('django.db.models.fields.TextField', [], {}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'last_activity_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
+ 'last_activity_by': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'last_active_in_questions'", 'to': "orm['forum.User']"}),
+ 'last_edited_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
+ 'last_edited_by': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'last_edited_questions'", 'null': 'True', 'to': "orm['forum.User']"}),
+ 'node_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['forum.Node']", 'unique': 'True', 'null': 'True'}),
+ 'offensive_flag_count': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}),
+ 'score': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
+ 'subscribers': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'subscriptions'", 'through': "'QuestionSubscription'", 'to': "orm['forum.User']"}),
+ 'summary': ('django.db.models.fields.CharField', [], {'max_length': '180'}),
+ 'tagnames': ('django.db.models.fields.CharField', [], {'max_length': '125'}),
+ 'tags': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'questions'", 'to': "orm['forum.Tag']"}),
+ 'title': ('django.db.models.fields.CharField', [], {'max_length': '300'}),
+ 'view_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
+ 'vote_down_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
+ 'vote_up_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
+ 'wiki': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
+ 'wikified_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'})
+ },
+ 'forum.questionrevision': {
+ 'Meta': {'object_name': 'QuestionRevision', 'db_table': "u'question_revision'"},
+ 'author': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'questionrevisions'", 'to': "orm['forum.User']"}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'question': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'revisions'", 'to': "orm['forum.Question']"}),
+ 'revised_at': ('django.db.models.fields.DateTimeField', [], {}),
+ 'revision': ('django.db.models.fields.PositiveIntegerField', [], {}),
+ 'summary': ('django.db.models.fields.CharField', [], {'max_length': '300', 'blank': 'True'}),
+ 'tagnames': ('django.db.models.fields.CharField', [], {'max_length': '125'}),
+ 'text': ('django.db.models.fields.TextField', [], {}),
+ 'title': ('django.db.models.fields.CharField', [], {'max_length': '300'})
+ },
+ 'forum.questionsubscription': {
+ 'Meta': {'object_name': 'QuestionSubscription'},
+ 'auto_subscription': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'last_view': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2010, 4, 14, 1, 29, 43, 727000)'}),
+ 'question': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['forum.Question']"}),
+ 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['forum.User']"})
+ },
+ 'forum.repute': {
+ 'Meta': {'object_name': 'Repute', 'db_table': "u'repute'"},
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'question': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['forum.Question']"}),
+ 'reputation_type': ('django.db.models.fields.SmallIntegerField', [], {}),
+ 'reputed_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
+ 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'reputes'", 'to': "orm['forum.User']"}),
+ 'user_previous_rep': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
+ 'value': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'})
+ },
+ 'forum.subscriptionsettings': {
+ 'Meta': {'object_name': 'SubscriptionSettings'},
+ 'all_questions': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
+ 'all_questions_watched_tags': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
+ 'enable_notifications': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'member_joins': ('django.db.models.fields.CharField', [], {'default': "'n'", 'max_length': '1'}),
+ 'new_question': ('django.db.models.fields.CharField', [], {'default': "'d'", 'max_length': '1'}),
+ 'new_question_watched_tags': ('django.db.models.fields.CharField', [], {'default': "'i'", 'max_length': '1'}),
+ 'notify_accepted': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
+ 'notify_answers': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
+ 'notify_comments': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
+ 'notify_comments_own_post': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
+ 'notify_reply_to_comments': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
+ 'questions_answered': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
+ 'questions_asked': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
+ 'questions_commented': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
+ 'questions_viewed': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
+ 'subscribed_questions': ('django.db.models.fields.CharField', [], {'default': "'i'", 'max_length': '1'}),
+ 'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'subscription_settings'", 'unique': 'True', 'to': "orm['forum.User']"})
+ },
+ 'forum.tag': {
+ 'Meta': {'object_name': 'Tag', 'db_table': "u'tag'"},
+ 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'created_tags'", 'to': "orm['forum.User']"}),
+ 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
+ 'deleted_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
+ 'deleted_by': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'deleted_tags'", 'null': 'True', 'to': "orm['forum.User']"}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'marked_by': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'marked_tags'", 'through': "'MarkedTag'", 'to': "orm['forum.User']"}),
+ 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}),
+ 'used_count': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'})
+ },
+ 'forum.user': {
+ 'Meta': {'object_name': 'User', '_ormbases': ['auth.User']},
+ 'about': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
+ 'bronze': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}),
+ 'date_of_birth': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
+ 'email_isvalid': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
+ 'email_key': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}),
+ 'gold': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}),
+ 'hide_ignored_questions': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
+ 'is_approved': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
+ 'last_seen': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
+ 'location': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
+ 'questions_per_page': ('django.db.models.fields.SmallIntegerField', [], {'default': '10'}),
+ 'real_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
+ 'reputation': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1'}),
+ 'silver': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}),
+ 'user_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True', 'primary_key': 'True'}),
+ 'website': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'})
+ },
+ 'forum.validationhash': {
+ 'Meta': {'unique_together': "(('user', 'type'),)", 'object_name': 'ValidationHash'},
+ 'expiration': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2010, 4, 15, 1, 29, 43, 815000)'}),
+ 'hash_code': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'seed': ('django.db.models.fields.CharField', [], {'max_length': '12'}),
+ 'type': ('django.db.models.fields.CharField', [], {'max_length': '12'}),
+ 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['forum.User']"})
+ },
+ 'forum.vote': {
+ 'Meta': {'object_name': 'Vote', 'db_table': "u'vote'"},
+ 'canceled': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
+ 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'node': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'votes'", 'null': 'True', 'to': "orm['forum.Node']"}),
+ 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {}),
+ 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'votes'", 'to': "orm['forum.User']"}),
+ 'vote': ('django.db.models.fields.SmallIntegerField', [], {}),
+ 'voted_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'})
+ }
+ }
+
+ complete_apps = ['forum']