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()
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')
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')
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()