Exemple #1
0
def create_sku_product_type_mapping(product_type):
    try:
        sp = SkuTypeProductTypeMapping.objects.get(account='nuezone',
                                                   sku_type=product_type.type,
                                                   product_type=product_type)
    except SkuTypeProductTypeMapping.DoesNotExist:
        sp = SkuTypeProductTypeMapping(account='nuezone',
                                       sku_type=product_type.type,
                                       product_type=product_type)
        sp.save()
Exemple #2
0
def create_sku_product_type_mapping(product_type):
    try:
        sp = SkuTypeProductTypeMapping.objects.using('default').get(
            account='HomeTown',
            sku_type=product_type.type,
            product_type=product_type)
    except SkuTypeProductTypeMapping.DoesNotExist:
        sp = SkuTypeProductTypeMapping(account='HomeTown',
                                       sku_type=product_type.type,
                                       product_type=product_type)
        sp.save(using='default')
Exemple #3
0
def create_sku_product_type_mapping(product_type):
    try:
        sp = SkuTypeProductTypeMapping.objects.using('default').get(account='HomeTown', sku_type = product_type.type, product_type = product_type)
    except SkuTypeProductTypeMapping.DoesNotExist:
        sp = SkuTypeProductTypeMapping(account='HomeTown', sku_type = product_type.type, product_type = product_type)
        sp.save(using='default')
Exemple #4
0
def create_sku_product_type_mapping(product_type):
    try:
        sp = SkuTypeProductTypeMapping.objects.get(account='nuezone', sku_type = product_type.type, product_type = product_type)
    except SkuTypeProductTypeMapping.DoesNotExist:
        sp = SkuTypeProductTypeMapping(account='nuezone', sku_type = product_type.type, product_type = product_type)
        sp.save()