Subversion Repositories SmartDukaan

Rev

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

Rev 19207 Rev 19280
Line 2383... Line 2383...
2383
    for val in cursor:
2383
    for val in cursor:
2384
        data.append(val)
2384
        data.append(val)
2385
    return data
2385
    return data
2386
 
2386
 
2387
def addFeaturedDealForDealObject(data):
2387
def addFeaturedDealForDealObject(data):
-
 
2388
    print data
-
 
2389
    
2388
    collection = get_mongo_connection().Catalog.FeaturedDealsDealObject
2390
    collection = get_mongo_connection().Catalog.FeaturedDealsDealObject
2389
    cursor = collection.find({'_id':data['_id']})
2391
    cursor = collection.find({'_id':data['_id']})
2390
    master = get_mongo_connection().Catalog.DealObject.find_one({'_id':data['_id']})
2392
    master = get_mongo_connection().Catalog.DealObject.find_one({'_id':data['_id']})
2391
    if master is None:
2393
    if master is None:
2392
        return {0:"Deal Object id wrong"}
2394
        return {0:"Deal Object id wrong"}
2393
    otherInfoObj = data['otherInfo']
2395
    otherInfoObj = data['otherInfo']
2394
    toPop = []
2396
    toPop = []
2395
    for x,y in otherInfoObj.iteritems():
2397
    for x,y in otherInfoObj.iteritems():
2396
        if y==0:
2398
        if y==0 or y=="":
2397
            toPop.append(x)
2399
            toPop.append(x)
2398
    
2400
    
2399
    for popItem in toPop:
2401
    for popItem in toPop:
2400
        otherInfoObj.pop(popItem)
2402
        otherInfoObj.pop(popItem)
2401
    if len(otherInfoObj.keys())==0:
2403
    if len(otherInfoObj.keys())==0: