|
@@ -7,6 +7,7 @@ from faker import Factory
|
|
|
|
|
|
from ....categories.models import Category
|
|
|
from ....core.management.progressbar import show_progress
|
|
|
+from ....core.pgutils import chunk_queryset
|
|
|
from ....threads.models import Thread
|
|
|
from ...posts import get_fake_hidden_post, get_fake_post, get_fake_unapproved_post
|
|
|
|
|
@@ -58,12 +59,13 @@ class Command(BaseCommand):
|
|
|
else:
|
|
|
get_fake_post(fake, thread, poster)
|
|
|
|
|
|
- thread.synchronize()
|
|
|
- thread.save()
|
|
|
-
|
|
|
created_posts += 1
|
|
|
show_progress(self, created_posts, items_to_create, start_time)
|
|
|
|
|
|
+ for thread in chunk_queryset(Thread.objects.all()):
|
|
|
+ thread.synchronize()
|
|
|
+ thread.save()
|
|
|
+
|
|
|
for category in Category.objects.all():
|
|
|
category.synchronize()
|
|
|
category.save()
|