Subversion Repositories SmartDukaan

Rev

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

Rev 29666 Rev 30079
Line 264... Line 264...
264
            itemMap['tagPricing'].append(tag)
264
            itemMap['tagPricing'].append(tag)
265
    
265
    
266
    catalogObjs = []
266
    catalogObjs = []
267
    for catalogId, catalogMap in catalogMap.iteritems():
267
    for catalogId, catalogMap in catalogMap.iteritems():
268
        print "catalogMap", catalogMap
268
        print "catalogMap", catalogMap
-
 
269
        active = True
269
        itemsMap = catalogMap['items']
270
        itemsMap = catalogMap['items']
270
        itemObjs = []
271
        itemObjs = []
271
        for itemId, itemMap in itemsMap.iteritems():
272
        for itemId, itemMap in itemsMap.iteritems():
272
            tags = itemMap['tagPricing']
273
            tags = itemMap['tagPricing']
273
            for tag in tags:
274
            for tag in tags:
-
 
275
                active = active and tag.active
274
                itemObj = {'id':('itemtag-%s-%s' % (itemId, tag.tag_id)), 'color_s':itemMap['color'], 'itemId_i': itemId, 'tagId_i':tag.tag_id,
276
                itemObj = {'id':('itemtag-%s-%s' % (itemId, tag.tag_id)), 'color_s':itemMap['color'], 'itemId_i': itemId, 'tagId_i':tag.tag_id,
275
                           'mrp_f':tag.mrp, 'mop_f': tag.mop, 'sellingPrice_f': tag.selling_price, 'active_b' : tag.active, 'hot_deal_b': tag.hot_deals}
277
                           'mrp_f':tag.mrp, 'mop_f': tag.mop, 'sellingPrice_f': tag.selling_price, 'active_b' : tag.active, 'hot_deal_b': tag.hot_deals}
276
            itemObjs.append(itemObj)
278
            itemObjs.append(itemObj)
277
        catalogObj = {'id':'catalog' + str(catalogId), 'rank_i':catalogMap['rank'], 'title_s': catalogMap['title'],
279
        catalogObj = {'id':'catalog' + str(catalogId), 'rank_i':catalogMap['rank'], 'title_s': catalogMap['title'],
278
                      '_childDocuments_':itemObjs,
280
                      '_childDocuments_':itemObjs,
Line 285... Line 287...
285
                      'subCategoryId_i':catalogMap['subCategoryId'],
287
                      'subCategoryId_i':catalogMap['subCategoryId'],
286
                      'w7573_i':0,
288
                      'w7573_i':0,
287
                      'w7678_i':0,
289
                      'w7678_i':0,
288
                      'w7720_i':0,
290
                      'w7720_i':0,
289
                      'w8468_i':0,
291
                      'w8468_i':0,
290
                      'w8889_i':0
292
                      'w8889_i':0,
-
 
293
                      'w8947_i':0
291
                      }
294
                      }
292
        for whId, color in catalogMap['avColor'].iteritems():
295
        for whId, color in catalogMap['avColor'].iteritems():
293
            print catalogId, whId, color, catalogMap['title']
296
            print catalogId, whId, color, catalogMap['title']
294
            catalogObj['w%d_i'%(whId)] = color
297
            catalogObj['w%d_i'%(whId)] = color
-
 
298
        catalogObj['active_b'] = active
295
        catalogObjs.append(catalogObj)
299
        catalogObjs.append(catalogObj)
296
    solr.delete(q='*:*')
300
    solr.delete(q='*:*')
297
    solr.add(catalogObjs)
301
    solr.add(catalogObjs)
298
 
302
 
299
 
303