Subversion Repositories SmartDukaan

Rev

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

Rev 19397 Rev 19398
Line 2693... Line 2693...
2693
    return specialOffer
2693
    return specialOffer
2694
 
2694
 
2695
def getBrandSubCategoryInfo(category_id, id_list, type):
2695
def getBrandSubCategoryInfo(category_id, id_list, type):
2696
    
2696
    
2697
    id_list_mapping = {}
2697
    id_list_mapping = {}
2698
    if type == "subCategoryInfo":
2698
    if type == "brandInfo":
2699
        brands = [int(brand_id) for brand_id in id_list.split('^')]
2699
        brands = [int(brand_id) for brand_id in id_list.split('^')]
2700
        for brand in brands:
2700
        for brand in brands:
2701
            tm_brand = get_mongo_connection().Catalog.Deals.find_one({'brand_id':brand},{'brand':1})
2701
            tm_brand = get_mongo_connection().Catalog.Deals.find_one({'brand_id':brand},{'brand':1})
2702
            id_list_mapping[brand_id] = tm_brand.get('brand')
2702
            id_list_mapping[brand_id] = tm_brand.get('brand')
2703
    elif type == "brandInfo":
2703
    elif type == "subCategoryInfo":
2704
        subCategories = [int(subCategoryId) for subCategoryId in id_list.split('^')]
2704
        subCategories = [int(subCategoryId) for subCategoryId in id_list.split('^')]
2705
        for subCat in subCategories:
2705
        for subCat in subCategories:
2706
            id_list_mapping[subCat] = SUB_CATEGORY_MAP.get(subCat)
2706
            id_list_mapping[subCat] = SUB_CATEGORY_MAP.get(subCat)
2707
    else:
2707
    else:
2708
        return {}
2708
        return {}