Subversion Repositories SmartDukaan

Rev

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

Rev 19686 Rev 19691
Line 22... Line 22...
22
    ProductFeedSubmit, MarketplaceItems, MarketPlaceItemPrice, \
22
    ProductFeedSubmit, MarketplaceItems, MarketPlaceItemPrice, \
23
    SourcePercentageMaster, SourceItemPercentage, FlipkartItem, \
23
    SourcePercentageMaster, SourceItemPercentage, FlipkartItem, \
24
    MarketPlaceUpdateHistory, SourceCategoryPercentage, MarketPlaceHistory, \
24
    MarketPlaceUpdateHistory, SourceCategoryPercentage, MarketPlaceHistory, \
25
    PrivateDeals, AmazonOutOfSync, PrivateDealsPriceComparison, \
25
    PrivateDeals, AmazonOutOfSync, PrivateDealsPriceComparison, \
26
    SourceReturnPercentage, CompetitorPricing, CompetitorPricingRequest, \
26
    SourceReturnPercentage, CompetitorPricing, CompetitorPricingRequest, \
27
    AmazonPromotion, ExclusiveAffiliateItemInfo, OutboundAffiliateMaster, HsItem, BulkItemPricing
27
    AmazonPromotion, ExclusiveAffiliateItemInfo, OutboundAffiliateMaster, HsItem, BulkItemPricing, \
-
 
28
    ItemWarrantyInfo, CategoryWarrantyInfo
28
from shop2020.thriftpy.model.v1.catalog.ttypes import status, ItemShippingInfo, \
29
from shop2020.thriftpy.model.v1.catalog.ttypes import status, ItemShippingInfo, \
29
    ItemType, PremiumType, FreebieItem as t_FreebieItem, \
30
    ItemType, PremiumType, FreebieItem as t_FreebieItem, \
30
    StorePricing as tStorePricing, CatalogServiceException, BannerType, InsurerType, \
31
    StorePricing as tStorePricing, CatalogServiceException, BannerType, InsurerType, \
31
    Banner as t_banner, CompetitorPricing as TCompetitorPricing, AmazonPromotionType
32
    Banner as t_banner, CompetitorPricing as TCompetitorPricing, AmazonPromotionType, ItemCondition
32
from shop2020.thriftpy.model.v1.inventory.ttypes import VatType, \
33
from shop2020.thriftpy.model.v1.inventory.ttypes import VatType, \
33
    InventoryServiceException, IgnoredInventoryUpdateItems, SnapdealInventoryItem
34
    InventoryServiceException, IgnoredInventoryUpdateItems, SnapdealInventoryItem
34
from shop2020.thriftpy.utils.ttypes import UserSmsInfo, SmsType
35
from shop2020.thriftpy.utils.ttypes import UserSmsInfo, SmsType
35
from shop2020.thriftpy.model.v1.order.ttypes import OrderSource
36
from shop2020.thriftpy.model.v1.order.ttypes import OrderSource
36
from shop2020.utils import EmailAttachmentSender
37
from shop2020.utils import EmailAttachmentSender
Line 3396... Line 3397...
3396
            i.brand = data.brand
3397
            i.brand = data.brand
3397
            i.model_name = data.model_name
3398
            i.model_name = data.model_name
3398
            i.model_number = data.model_number
3399
            i.model_number = data.model_number
3399
    session.commit()
3400
    session.commit()
3400
 
3401
 
-
 
3402
def get_warranty_info_for_item(itemId, itemCondition):
-
 
3403
    itemWarrantyInfo = ItemWarrantyInfo.query.filter(and_(ItemWarrantyInfo.itemId==itemId, ItemWarrantyInfo.itemCondition==itemCondition)).first()
-
 
3404
    itemwarrantyinfoMap = {}
-
 
3405
    if itemWarrantyInfo is None:
-
 
3406
        item = get_item(itemId)
-
 
3407
        if item is None:
-
 
3408
            raise CatalogServiceException(itemId, "Could not find item in catalog")
-
 
3409
        categoryWarrantyInfo = CategoryWarrantyInfo.query.filter(and_(CategoryWarrantyInfo.categoryId==item.category, CategoryWarrantyInfo.brand==item.brand, CategoryWarrantyInfo.itemCondition==itemCondition)).first()
-
 
3410
        if categoryWarrantyInfo is None:
-
 
3411
            raise CatalogServiceException(item.id, "Could not find warrabty info for this item id" + str(item.id) + " for " + str(ItemCondition._VALUES_TO_NAMES[itemCondition]))
-
 
3412
        itemwarrantyinfoMap[categoryWarrantyInfo.warrantyPeriodType] = categoryWarrantyInfo.warrantyVal
-
 
3413
    else:
-
 
3414
        itemwarrantyinfoMap[itemWarrantyInfo.warrantyPeriodType] = itemWarrantyInfo.warrantyVal
-
 
3415
    return itemwarrantyinfoMap
-
 
3416
 
3401
if __name__=='__main__':
3417
if __name__=='__main__':
3402
    DataService.initialize()
3418
    DataService.initialize()
3403
    #update_bulk_prices_on_production(21053,[])
3419
    #update_bulk_prices_on_production(21053,[])
3404
    print get_cart_by_value([1005394,46868158])
3420
    print get_cart_by_value([1005394,46868158])
3405
    
3421
    
3406
3422