Subversion Repositories SmartDukaan

Rev

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

Rev 16406 Rev 16450
Line 1127... Line 1127...
1127
        return {0:'Unable to add data.'}
1127
        return {0:'Unable to add data.'}
1128
 
1128
 
1129
def getAllNotifications(offset, limit):
1129
def getAllNotifications(offset, limit):
1130
    data = []
1130
    data = []
1131
    collection = get_mongo_connection().Catalog.Notifications
1131
    collection = get_mongo_connection().Catalog.Notifications
1132
    cursor = collection.find().skip(offset).limit(limit)
1132
    cursor = collection.find().sort([('endDate',pymongo.DESCENDING)]).skip(offset).limit(limit)
1133
    for val in cursor:
1133
    for val in cursor:
1134
        master = list(get_mongo_connection().Catalog.MasterData.find({'skuBundleId':val['skuBundleId']}))
1134
        master = list(get_mongo_connection().Catalog.MasterData.find({'skuBundleId':val['skuBundleId']}))
1135
        if len(master) > 0:
1135
        if len(master) > 0:
1136
            val['brand'] = master[0]['brand']
1136
            val['brand'] = master[0]['brand']
1137
            val['model_name'] = master[0]['model_name']
1137
            val['model_name'] = master[0]['model_name']