Subversion Repositories SmartDukaan

Rev

Rev 17737 | Rev 17756 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 17737 Rev 17746
Line 1441... Line 1441...
1441
        data['skuBundleId'] = max_bundle[0]['skuBundleId'] + 1
1441
        data['skuBundleId'] = max_bundle[0]['skuBundleId'] + 1
1442
        data['identifier'] = str(data['identifier'])
1442
        data['identifier'] = str(data['identifier'])
1443
        data['secondaryIdentifier'] = str(data['secondaryIdentifier'])
1443
        data['secondaryIdentifier'] = str(data['secondaryIdentifier'])
1444
        data['model_name'] = str(data['model_name'])
1444
        data['model_name'] = str(data['model_name'])
1445
        data['brand_id'] = __getBrandIdForBrand(data['brand'], data['category_id'])
1445
        data['brand_id'] = __getBrandIdForBrand(data['brand'], data['category_id'])
-
 
1446
        data['shippingCost'] = float(data['shippingCost'])
1446
        if data['category_id'] ==6 and data['subCategoryId'] ==0:
1447
        if data['category_id'] ==6 and data['subCategoryId'] ==0:
1447
            return {0:'Sub-Category not selected'}
1448
            return {0:'Sub-Category not selected'}
1448
        elif data['category_id'] !=6 and data['subCategoryId'] !=0:
1449
        elif data['category_id'] !=6 and data['subCategoryId'] !=0:
1449
            return {0:'Sub-Category not valid'}
1450
            return {0:'Sub-Category not valid'}
1450
        else:
1451
        else:
Line 1467... Line 1468...
1467
        data['_id'] = max_id[0]['_id'] + 1
1468
        data['_id'] = max_id[0]['_id'] + 1
1468
        data['identifier'] = str(data['identifier'])
1469
        data['identifier'] = str(data['identifier'])
1469
        data['secondaryIdentifier'] = str(data['secondaryIdentifier'])
1470
        data['secondaryIdentifier'] = str(data['secondaryIdentifier'])
1470
        data['model_name'] = str(data['model_name'])
1471
        data['model_name'] = str(data['model_name'])
1471
        data['brand_id'] = __getBrandIdForBrand(data['brand'], data['category_id'])
1472
        data['brand_id'] = __getBrandIdForBrand(data['brand'], data['category_id'])
-
 
1473
        data['shippingCost'] = float(data['shippingCost'])
1472
        if data['category_id'] ==6 and data['subCategoryId'] ==0:
1474
        if data['category_id'] ==6 and data['subCategoryId'] ==0:
1473
            return {0:'Sub-Category not selected'}
1475
            return {0:'Sub-Category not selected'}
1474
        elif data['category_id'] !=6 and data['subCategoryId'] !=0:
1476
        elif data['category_id'] !=6 and data['subCategoryId'] !=0:
1475
            return {0:'Sub-Category not valid'}
1477
            return {0:'Sub-Category not valid'}
1476
        else:
1478
        else:
Line 1492... Line 1494...
1492
            skuBundleId = data.pop('skuBundleId')
1494
            skuBundleId = data.pop('skuBundleId')
1493
            data['updatedOn'] = to_java_date(datetime.now())
1495
            data['updatedOn'] = to_java_date(datetime.now())
1494
            data['identifier'] = str(data['identifier'])
1496
            data['identifier'] = str(data['identifier'])
1495
            data['secondaryIdentifier'] = str(data['secondaryIdentifier'])
1497
            data['secondaryIdentifier'] = str(data['secondaryIdentifier'])
1496
            data['model_name'] = str(data['model_name'])
1498
            data['model_name'] = str(data['model_name'])
-
 
1499
            data['shippingCost'] = float(data['shippingCost'])
1497
            data['brand_id'] = __getBrandIdForBrand(data['brand'], data['category_id'])
1500
            data['brand_id'] = __getBrandIdForBrand(data['brand'], data['category_id'])
1498
            if data['category_id'] ==6 and data['subCategoryId'] ==0:
1501
            if data['category_id'] ==6 and data['subCategoryId'] ==0:
1499
                return {0:'Sub-Category not selected'}
1502
                return {0:'Sub-Category not selected'}
1500
            elif data['category_id'] !=6 and data['subCategoryId'] !=0:
1503
            elif data['category_id'] !=6 and data['subCategoryId'] !=0:
1501
                return {0:'Sub-Category not valid'}
1504
                return {0:'Sub-Category not valid'}
Line 1510... Line 1513...
1510
            data['updatedOn'] = to_java_date(datetime.now())
1513
            data['updatedOn'] = to_java_date(datetime.now())
1511
            data['identifier'] = str(data['identifier'])
1514
            data['identifier'] = str(data['identifier'])
1512
            data['secondaryIdentifier'] = str(data['secondaryIdentifier'])
1515
            data['secondaryIdentifier'] = str(data['secondaryIdentifier'])
1513
            data['brand_id'] = __getBrandIdForBrand(data['brand'], data['category_id'])
1516
            data['brand_id'] = __getBrandIdForBrand(data['brand'], data['category_id'])
1514
            data['model_name'] = str(data['model_name'])
1517
            data['model_name'] = str(data['model_name'])
-
 
1518
            data['shippingCost'] = float(data['shippingCost'])
1515
            if data['category_id'] ==6 and data['subCategoryId'] ==0:
1519
            if data['category_id'] ==6 and data['subCategoryId'] ==0:
1516
                return {0:'Sub-Category not selected'}
1520
                return {0:'Sub-Category not selected'}
1517
            elif data['category_id'] !=6 and data['subCategoryId'] !=0:
1521
            elif data['category_id'] !=6 and data['subCategoryId'] !=0:
1518
                return {0:'Sub-Category not valid'}
1522
                return {0:'Sub-Category not valid'}
1519
            else:
1523
            else:
Line 1702... Line 1706...
1702
        if mpu.find("snapdeal")!=-1:
1706
        if mpu.find("snapdeal")!=-1:
1703
            mpu = "http://m.snapdeal.com"+mpu[mpu.find("/product"):]
1707
            mpu = "http://m.snapdeal.com"+mpu[mpu.find("/product"):]
1704
        elif mpu.find("homeshop18")!=-1:
1708
        elif mpu.find("homeshop18")!=-1:
1705
            mpu = "http://m.homeshop18.com/product.mobi?productId="+item['identifier']
1709
            mpu = "http://m.homeshop18.com/product.mobi?productId="+item['identifier']
1706
        elif mpu.find("saholic.com")!=-1:
1710
        elif mpu.find("saholic.com")!=-1:
1707
            mpu = mpu.replace("saholic.com", "m.saholic.com")
1711
            mpu = "http://m."+mpu[mpu.find("saholic.com"):]
1708
        elif mpu.find("shopclues.com")!=-1:
1712
        elif mpu.find("shopclues.com")!=-1:
1709
            mpu = "http://m."+mpu[mpu.find("shopclues.com"):]
1713
            mpu = "http://m."+mpu[mpu.find("shopclues.com"):]
1710
        else:
1714
        else:
1711
            pass
1715
            pass
1712
    
1716