Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Again!

  • Loading branch information...
commit 2bf9e1abfb6a33c763e6a7792de2e96cdb7da59c 1 parent 065e500
@mythmon authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 migrations/226-retopic-questions.py
View
5 migrations/226-retopic-questions.py
@@ -26,10 +26,11 @@ def run():
% (product_slug, topic_desc['topic']))
# Assign all the right new topics to the right old topics.
- for product in Product.objects.all().select_related('questions'):
+ for product in Product.objects.all():
topics = Topic.objects.filter(product=product)
for topic in topics:
- questions = Question.objects.filter(old_topics__slug=topic.slug)
+ questions = Question.objects.filter(products=product,
+ old_topics__slug=topic.slug)
print '%s / %s (%d questions)' % (product.title, topic.title, len(questions))
for q in questions:
q.topics.add(topic)
Please sign in to comment.
Something went wrong with that request. Please try again.