Created
May 31, 2013 22:54
-
-
Save micronax/5688474 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
productToPush = { | |
'name': self.getName(article), | |
'active': True, | |
'tax': 19, | |
'laststock': self.lastStock, | |
'supplier': self.getManufacturerById(article[self.cols.index('lieferantnr')]), | |
'categories': [{'id': categoryId} for categoryId in self.getCategoryMapping(article)], | |
'variants': [ | |
{ | |
'isMain': isMain, | |
'active': True, | |
'number': subnumber, | |
'inStock': variant['stock'], | |
'additionaltext': 'Größe ' + str(variant['size']), | |
'configuratorOptions': [ | |
{ | |
'group': 'Größe', | |
'option': variant['size'] | |
} | |
], | |
'prices': [{ | |
'customerGroupKey': 'EK', | |
'price': variant['price'], | |
}], | |
'attribute': { | |
'attr1': variant['size'], | |
'attr2': article[self.cols.index('bestellnr')] | |
}, | |
}, { | |
'isMain': isMain, | |
'active': True, | |
'number': subnumber, | |
'inStock': variant['stock'], | |
'additionaltext': 'Größe ' + str(variant['size']), | |
'configuratorOptions': [ | |
{ | |
'group': 'Größe', | |
'option': variant['size'] | |
} | |
], | |
'prices': [{ | |
'customerGroupKey': 'EK', | |
'price': variant['price'], | |
}], | |
'attribute': { | |
'attr1': variant['size'], | |
'attr2': article[self.cols.index('bestellnr')] | |
}, | |
}, | |
], | |
'mainDetail': { | |
'number': fstVariantNumber, | |
'prices': [ | |
{ | |
'customerGroupKey': 'EK', | |
'price': variants[0]['price'], | |
} | |
] | |
}, | |
'filterGroupId': 3, | |
'propertyValues': [ | |
{ | |
'option': {'name': 'Farbe'}, | |
'value': self.getColor(article) | |
}, | |
], | |
'configuratorSet': { | |
'groups': [ | |
{ | |
'name': 'Größe', | |
'options': [{'name': variant['size']} for variant in variants] | |
} | |
] | |
}, | |
'images': [{ | |
'link': self.ftpCreds['httpRoot'] + '/' + article[ | |
self.cols.index('artnr')] + '/' + os.path.basename(image), | |
'description': '', | |
} for image in articleImages | |
], | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment