Subversion Repositories SmartDukaan

Rev

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

Rev 19400 Rev 19401
Line 2696... Line 2696...
2696
    
2696
    
2697
    id_list_mapping = {}
2697
    id_list_mapping = {}
2698
    if type == "brandInfo":
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
            print brand
-
 
2702
            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})
2703
            print tm_brand
-
 
2704
            id_list_mapping[brand_id] = tm_brand.get('brand')
2702
            id_list_mapping[brand] = tm_brand.get('brand')
2705
    elif type == "subCategoryInfo":
2703
    elif type == "subCategoryInfo":
2706
        subCategories = [int(subCategoryId) for subCategoryId in id_list.split('^')]
2704
        subCategories = [int(subCategoryId) for subCategoryId in id_list.split('^')]
2707
        for subCat in subCategories:
2705
        for subCat in subCategories:
2708
            id_list_mapping[subCat] = SUB_CATEGORY_MAP.get(subCat)
2706
            id_list_mapping[subCat] = SUB_CATEGORY_MAP.get(subCat)
2709
    else:
2707
    else:
2710
        return {}
2708
        return {}
2711
    print id_list_mapping
-
 
2712
    
2709
    
2713
    if mc.get("brandSubCategoryInfo") is None:
2710
    if mc.get("brandSubCategoryInfo") is None:
2714
        collection =  get_mongo_connection().Catalog.Deals
2711
        collection =  get_mongo_connection().Catalog.Deals
2715
        result = collection.aggregate( 
2712
        result = collection.aggregate( 
2716
                [
2713
                [