summaryrefslogtreecommitdiffstats
path: root/stackexchange/management/commands/load_stackexchange.py
diff options
context:
space:
mode:
authorEvgeny Fadeev <evgeny.fadeev@gmail.com>2010-03-11 22:24:49 -0500
committerEvgeny Fadeev <evgeny.fadeev@gmail.com>2010-03-11 22:24:49 -0500
commit18318c5fe8dbae1ee50924aa5b8cf7b683d409ee (patch)
treeb17abbf2f2a864dc3e7079ec9abb0333ea245c2e /stackexchange/management/commands/load_stackexchange.py
parent2ac7ee2433ca2de37aae2a4701bb10dda290d5d3 (diff)
downloadaskbot-18318c5fe8dbae1ee50924aa5b8cf7b683d409ee.tar.gz
askbot-18318c5fe8dbae1ee50924aa5b8cf7b683d409ee.tar.bz2
askbot-18318c5fe8dbae1ee50924aa5b8cf7b683d409ee.zip
fixed circular dependency on models.signals and the question count on import
Diffstat (limited to 'stackexchange/management/commands/load_stackexchange.py')
-rw-r--r--stackexchange/management/commands/load_stackexchange.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/stackexchange/management/commands/load_stackexchange.py b/stackexchange/management/commands/load_stackexchange.py
index 11b0efc9..afe4b9ea 100644
--- a/stackexchange/management/commands/load_stackexchange.py
+++ b/stackexchange/management/commands/load_stackexchange.py
@@ -30,6 +30,7 @@ xml_read_order = (
#association tables SE item id --> OSQA item id
#table associations are implied
+#todo: there is an issue that these may be inconsistent with the database
USER = {}#SE User.id --> django(OSQA) User.id
QUESTION = {}
ANSWER = {}
@@ -383,7 +384,7 @@ class Command(BaseCommand):
)
QUESTION[rev_group[0].post.id] = q
elif post_type == 'Answer':
- q = QUESTION[rev_group[0].post.parent.id]
+ q = X.get_post(rev_group[0].post.parent)
a = osqa.Answer.objects.create_new(
question = q,
author = author,
@@ -419,7 +420,7 @@ class Command(BaseCommand):
post_type = rev0.post.post_type.name
if post_type == 'Question':
- q = QUESTION[rev0.post.id]
+ q = X.get_post(rev0.post)
q.apply_edit(
edited_at = edited_at,
edited_by = edited_by,
@@ -429,7 +430,7 @@ class Command(BaseCommand):
tags = tags,
)
elif post_type == 'Answer':
- a = ANSWER[rev0.post.id]
+ a = X.get_post(rev0.post)
a.apply_edit(
edited_at = edited_at,
edited_by = edited_by,