Subversion Repositories SmartDukaan

Rev

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

Rev 31105 Rev 31559
Line 267... Line 267...
267
    for catalogId, catalogMap in catalogMap.iteritems():
267
    for catalogId, catalogMap in catalogMap.iteritems():
268
        print "catalogMap", catalogMap
268
        print "catalogMap", catalogMap
269
        active = False
269
        active = False
270
        itemsMap = catalogMap['items']
270
        itemsMap = catalogMap['items']
271
        itemObjs = []
271
        itemObjs = []
-
 
272
        mop = 0
272
        for itemId, itemMap in itemsMap.iteritems():
273
        for itemId, itemMap in itemsMap.iteritems():
273
            tags = itemMap.pop('tagPricing')
274
            tags = itemMap.pop('tagPricing')
274
 
275
 
275
            for tag in tags:
276
            for tag in tags:
276
                active = active or tag.active
277
                active = active or tag.active
277
                itemObj = {'id':('itemtag-%s-%s' % (itemId, tag.tag_id)), 'color_s':itemMap['color'], 'itemId_i': itemId, 'tagId_i':tag.tag_id,
278
                itemObj = {'id':('itemtag-%s-%s' % (itemId, tag.tag_id)), 'color_s':itemMap['color'], 'itemId_i': itemId, 'tagId_i':tag.tag_id,
278
                           'mrp_f':tag.mrp, 'mop_f': tag.mop, 'sellingPrice_f': tag.selling_price, 'active_b' : tag.active, 'hot_deal_b': tag.hot_deals}
279
                           'mrp_f':tag.mrp, 'mop_f': tag.mop, 'sellingPrice_f': tag.selling_price, 'active_b' : tag.active, 'hot_deal_b': tag.hot_deals}
-
 
280
                mop = tag.mop
279
            itemObjs.append(itemObj)
281
            itemObjs.append(itemObj)
280
        catalogObj = {'id':'catalog' + str(catalogId), 'rank_i':catalogMap['rank'], 'title_s': catalogMap['title'],
282
        catalogObj = {'id':'catalog' + str(catalogId), 'rank_i':catalogMap['rank'], 'title_s': catalogMap['title'],
281
                      '_childDocuments_':itemObjs,
283
                      '_childDocuments_':itemObjs,
282
                      'child_b' : len(itemObjs) > 0,
284
                      'child_b' : len(itemObjs) > 0,
283
                      'catalogId_i':catalogId,
285
                      'catalogId_i':catalogId,
Line 292... Line 294...
292
                      'w8468_i':0,
294
                      'w8468_i':0,
293
                      'w8889_i':0,
295
                      'w8889_i':0,
294
                      'w8947_i':0,
296
                      'w8947_i':0,
295
                      'w9213_i':0,
297
                      'w9213_i':0,
296
                      'w9203_i':0
298
                      'w9203_i':0
297
                      
299
                      'mop_f': mop
298
                      }
300
                      }
299
        for whId, color in catalogMap['avColor'].iteritems():
301
        for whId, color in catalogMap['avColor'].iteritems():
300
            print catalogId, whId, color, catalogMap['title']
302
            print catalogId, whId, color, catalogMap['title']
301
            catalogObj['w%d_i'%(whId)] = color
303
            catalogObj['w%d_i'%(whId)] = color
302
        catalogObj['active_b'] = active
304
        catalogObj['active_b'] = active