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