|
|
|
|
@ -9,15 +9,16 @@ class Command(BaseCommand): |
|
|
|
|
# Create colors |
|
|
|
|
self.stdout.write('Creating colors...') |
|
|
|
|
colors = [ |
|
|
|
|
{'name': 'Black', 'hex': '#000000', 'secondary_hex': None}, |
|
|
|
|
{'name': 'White', 'hex': '#FFFFFF', 'secondary_hex': None}, |
|
|
|
|
{'name': 'Red', 'hex': '#FF0000', 'secondary_hex': None}, |
|
|
|
|
{'name': 'Blue', 'hex': '#0000FF', 'secondary_hex': None}, |
|
|
|
|
{'name': 'Green', 'hex': '#00FF00', 'secondary_hex': None}, |
|
|
|
|
{'name': 'Yellow', 'hex': '#FFFF00', 'secondary_hex': None}, |
|
|
|
|
{'name': 'Black/White', 'hex': '#000000', 'secondary_hex': '#FFFFFF'}, |
|
|
|
|
{'name': 'Red/Blue', 'hex': '#FF0000', 'secondary_hex': '#0000FF'}, |
|
|
|
|
{'name': 'Green/Yellow', 'hex': '#00FF00', 'secondary_hex': '#FFFF00'} |
|
|
|
|
{'name': 'Noir', 'hex': '#333333', 'secondary_hex': None}, |
|
|
|
|
{'name': 'Noir / Gris Foncé Chiné', 'hex': '#000000', 'secondary_hex': '#4D4D4D'}, |
|
|
|
|
{'name': 'Bleu Sport', 'hex': '#112B44', 'secondary_hex': None}, |
|
|
|
|
{'name': 'Bleu Sport / Bleu Sport Chiné', 'hex': '#112B44', 'secondary_hex': '#16395A'}, |
|
|
|
|
{'name': 'Bleu Sport / Blanc', 'hex': '#112B44', 'secondary_hex': '#FFFFFF'}, |
|
|
|
|
{'name': 'Blanc / Gris Clair', 'hex': '#FFFFFF', 'secondary_hex': '#D3D3D3'}, |
|
|
|
|
{'name': 'Fuchsia', 'hex': '#C1366B', 'secondary_hex': None}, |
|
|
|
|
{'name': 'Corail / Noir', 'hex': '#FF7F50', 'secondary_hex': '#000000'}, |
|
|
|
|
{'name': 'Blanc / Bleu Sport', 'hex': '#FFFFFF', 'secondary_hex': '#112B44'}, |
|
|
|
|
{'name': 'Blanc', 'hex': '#FFFFFF', 'secondary_hex': None}, |
|
|
|
|
] |
|
|
|
|
|
|
|
|
|
color_objects = {} |
|
|
|
|
@ -44,7 +45,7 @@ class Command(BaseCommand): |
|
|
|
|
|
|
|
|
|
# Create sizes |
|
|
|
|
self.stdout.write('Creating sizes...') |
|
|
|
|
sizes = ['XS', 'S', 'M', 'L', 'XL', 'XXL'] |
|
|
|
|
sizes = ['XS', 'S', 'M', 'L', 'XL', 'XXL', '3XL', '4XL'] |
|
|
|
|
|
|
|
|
|
size_objects = {} |
|
|
|
|
for name in sizes: |
|
|
|
|
@ -60,37 +61,81 @@ class Command(BaseCommand): |
|
|
|
|
products = [ |
|
|
|
|
{ |
|
|
|
|
'sku': 'PC001', |
|
|
|
|
'title': 'Tennis Racket Pro', |
|
|
|
|
'description': 'Professional grade tennis racket with advanced stability control.', |
|
|
|
|
'price': 99.99, |
|
|
|
|
'title': 'Padel Club Cap', |
|
|
|
|
'description': 'Casquette logo centre', |
|
|
|
|
'price': 25.00, |
|
|
|
|
'ordering_value': 1, |
|
|
|
|
'cut': 2, # Men |
|
|
|
|
'colors': ['Black/White'], |
|
|
|
|
'sizes': ['M', 'L', 'XL'], |
|
|
|
|
'cut': 0, # Unisex |
|
|
|
|
'colors': ['Blanc', 'Bleu Sport', 'Noir'], |
|
|
|
|
'sizes': [], |
|
|
|
|
'image_filename': 'hat.jpg' |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
'sku': 'PC002', |
|
|
|
|
'title': 'Sports T-Shirt', |
|
|
|
|
'description': 'Breathable sports t-shirt made with moisture-wicking fabric.', |
|
|
|
|
'price': 29.99, |
|
|
|
|
'sku': 'PC002', |
|
|
|
|
'title': 'Padel Club Hoodie F', |
|
|
|
|
'description': 'Hoodie femme logo cœur et dos', |
|
|
|
|
'price': 50.00, |
|
|
|
|
'ordering_value': 1, |
|
|
|
|
'cut': 1, |
|
|
|
|
'colors': ['Blanc', 'Bleu Sport', 'Noir', 'Fuchsia'], |
|
|
|
|
'sizes': ['XS', 'S', 'M', 'L', 'XL', 'XXL'], |
|
|
|
|
'image_filename': 'PS_K473_WHITE.png.avif' |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
'sku': 'PC003', |
|
|
|
|
'title': 'Padel Club Hoodie H', |
|
|
|
|
'description': 'Hoodie homme logo cœur et dos', |
|
|
|
|
'price': 50.00, |
|
|
|
|
'ordering_value': 2, |
|
|
|
|
'cut': 2, |
|
|
|
|
'colors': ['Blanc', 'Bleu Sport', 'Noir', 'Fuchsia'], |
|
|
|
|
'sizes': ['XS', 'S', 'M', 'L', 'XL', 'XXL', '3XL', '4XL'], |
|
|
|
|
'image_filename': 'PS_K476_WHITE.png.avif' |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
'sku': 'PC004', |
|
|
|
|
'title': 'Débardeur F', |
|
|
|
|
'description': 'Débardeur femme avec logo coeur.', |
|
|
|
|
'price': 20.00, |
|
|
|
|
'ordering_value': 2, |
|
|
|
|
'cut': 1, # Women |
|
|
|
|
'colors': ['Black', 'White', 'Blue', 'Red', 'Red/Blue'], |
|
|
|
|
'colors': ['Blanc / Bleu Sport', 'Noir', 'Noir / Gris Foncé Chiné'], |
|
|
|
|
'sizes': ['XS', 'S', 'M', 'L', 'XL'], |
|
|
|
|
'image_filename': 'tshirt.jpg' |
|
|
|
|
'image_filename': 'PS_PA4031_WHITE-SPORTYNAVY.png.avif' |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
'sku': 'PC005', |
|
|
|
|
'title': 'Jupe bicolore F', |
|
|
|
|
'description': 'Avec short intégré logo jambe (sauf corail)', |
|
|
|
|
'price': 30.00, |
|
|
|
|
'ordering_value': 3, |
|
|
|
|
'cut': 1, # Women |
|
|
|
|
'colors': ['Blanc / Bleu Sport', 'Bleu Sport / Blanc', 'Corail / Noir', 'Noir / Gris Foncé Chiné'], |
|
|
|
|
'sizes': ['XS', 'S', 'M', 'L', 'XL'], |
|
|
|
|
'image_filename': 'PS_PA1031_WHITE-SPORTYNAVY.png.avif' |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
'sku': 'PC003', |
|
|
|
|
'title': 'Kids Tennis Shorts', |
|
|
|
|
'description': 'Comfortable tennis shorts for kids with elastic waistband.', |
|
|
|
|
'price': 19.99, |
|
|
|
|
'sku': 'PC006', |
|
|
|
|
'title': 'T-shirt Bicolore H', |
|
|
|
|
'description': 'T-shirt bicolore avec logo coeur.', |
|
|
|
|
'price': 25.00, |
|
|
|
|
'ordering_value': 1, |
|
|
|
|
'cut': 2, # Men |
|
|
|
|
'colors': ['Blanc / Bleu Sport', 'Noir', 'Noir / Gris Foncé Chiné'], |
|
|
|
|
'sizes': ['S', 'M', 'L', 'XL', 'XXL', '3XL'], |
|
|
|
|
'image_filename': 'tshirt_h.png' |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
'sku': 'PC007', |
|
|
|
|
'title': 'Short Bicolore H', |
|
|
|
|
'description': 'Short bicolore avec logo jambe.', |
|
|
|
|
'price': 30.00, |
|
|
|
|
'ordering_value': 3, |
|
|
|
|
'cut': 3, # Kids |
|
|
|
|
'colors': ['Blue', 'White', 'Green/Yellow'], |
|
|
|
|
'sizes': ['XS', 'S', 'M'], |
|
|
|
|
'image_filename': 'kids_shorts.jpg' |
|
|
|
|
} |
|
|
|
|
'cut': 2, # Men |
|
|
|
|
'colors': ['Blanc / Bleu Sport', 'Noir', 'Noir / Gris Foncé Chiné'], |
|
|
|
|
'sizes': ['S', 'M', 'L', 'XL', 'XXL', '3XL'], |
|
|
|
|
'image_filename': 'PS_PA1030_WHITE-SPORTYNAVY.png.avif' |
|
|
|
|
}, |
|
|
|
|
] |
|
|
|
|
|
|
|
|
|
for product_data in products: |
|
|
|
|
|