Subversion Repositories SmartDukaan

Rev

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

Rev 17559 Rev 17561
Line 1238... Line 1238...
1238
    return data
1238
    return data
1239
 
1239
 
1240
def getAllFeaturedDeals(offset, limit):
1240
def getAllFeaturedDeals(offset, limit):
1241
    data = []
1241
    data = []
1242
    collection = get_mongo_connection().Catalog.FeaturedDeals
1242
    collection = get_mongo_connection().Catalog.FeaturedDeals
1243
    cursor = collection.find({})
1243
    cursor = collection.find({}).skip(offset).limit(limit)
1244
    for val in cursor:
1244
    for val in cursor:
1245
        master = list(get_mongo_connection().Catalog.MasterData.find({'skuBundleId':val['skuBundleId']}))
1245
        master = list(get_mongo_connection().Catalog.MasterData.find({'skuBundleId':val['skuBundleId']}))
1246
        if len(master) > 0:
1246
        if len(master) > 0:
1247
            val['brand'] = master[0]['brand']
1247
            val['brand'] = master[0]['brand']
1248
            val['source_product_name'] = master[0]['source_product_name']
1248
            val['source_product_name'] = master[0]['source_product_name']
Line 2072... Line 2072...
2072
        get_mongo_connection().Catalog.DealObject.insert(data)
2072
        get_mongo_connection().Catalog.DealObject.insert(data)
2073
        return {1:'Data added successfully'}
2073
        return {1:'Data added successfully'}
2074
    except:
2074
    except:
2075
        return {0:'Error in adding data'}
2075
        return {0:'Error in adding data'}
2076
 
2076
 
-
 
2077
def getAllDealObjects(offset, limit):
-
 
2078
    data = []
-
 
2079
    collection = get_mongo_connection().Catalog.DealObject
-
 
2080
    cursor = collection.find({}).skip(offset).limit(limit)
-
 
2081
    for val in cursor:
-
 
2082
        data.append(val['_id'],val['name'])
-
 
2083
    return data
-
 
2084
    
-
 
2085
    
-
 
2086
 
2077
def main():
2087
def main():
2078
    data = {'hello':"ya"}
2088
    data = {'hello':"ya"}
2079
    addDealObject(data)
2089
    addDealObject(data)
2080
 
2090
 
2081
        
2091