]> git.parisson.com Git - diggersdigest.git/commitdiff
Update populate_db management command
authorThomas Fillon <thomas@parisson.com>
Thu, 24 Sep 2015 09:58:13 +0000 (11:58 +0200)
committerThomas Fillon <thomas@parisson.com>
Thu, 24 Sep 2015 21:11:42 +0000 (23:11 +0200)
app/records/management/commands/populate_db.py

index f063718d1b65b851330bc43321b3dc79c2d8313d..eba813795b0d81aaccfe0bbaa1fc55410d4c2814 100644 (file)
@@ -477,6 +477,10 @@ class Command(BaseCommand):
             product.title = record.title
             product.content = shop.desc
 
+            product.slug = ''  # If left blank, the main title field will be used.
+            product.description = ''  # Leave blank to have the URL auto-generated from the title.
+            product.gen_description = True
+
             # Category
             theme = rec_models.Theme.objects.get(id=shop.theme)
             category_id = THEME_TO_CATEGORY[theme.pk]
@@ -508,7 +512,7 @@ class Command(BaseCommand):
             product.save()
 
             default_variation = product.variations.get(default=True)
-            default_variation.sku = "DD_REC_" + str(record.pk)
+            default_variation.sku = "REC_" + str(record.pk)
             default_variation.save()
 
             self.stdout.write('Product %d / %d --> %s' % (product.pk,len(OLD_SHOP_LIST), product.available))