Subversion Repositories SmartDukaan

Rev

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

Rev 14482 Rev 14485
Line 665... Line 665...
665
        return {0:"Document not deleted."}
665
        return {0:"Document not deleted."}
666
 
666
 
667
def searchMaster(offset, limit, search_term):
667
def searchMaster(offset, limit, search_term):
668
    data = []
668
    data = []
669
    try:
669
    try:
670
        collection = get_mongo_connection().Catalog.MasterData.find({'source_product_name':re.compile(search_term, re.IGNORECASE),'source_id':{'$in':SOURCE_MAP.keys()}}).offset(offset).limit(limit)
670
        collection = get_mongo_connection().Catalog.MasterData.find({'source_product_name':re.compile(search_term, re.IGNORECASE),'source_id':{'$in':SOURCE_MAP.keys()}}).skip(offset).limit(limit)
671
        for record in collection:
671
        for record in collection:
672
            data.append(record)
672
            data.append(record)
673
    except:
673
    except:
674
        pass
674
        pass
675
    return data
675
    return data
676
 
676
 
677
def main():
677
def main():
678
    x = getNewDeals(1, 0, 0, 500, None, None)
678
    print searchMaster(0, 10, "iphone")
679
    for i in x:
-
 
680
        print i['_id'],
-
 
681
        print '\t',
-
 
682
        print i['persPoints']
-
 
683
    
679
    
684
    
680
    
685
if __name__=='__main__':
681
if __name__=='__main__':
686
    main()
682
    main()