Subversion Repositories SmartDukaan

Rev

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

Rev 17561 Rev 17564
Line 2077... Line 2077...
2077
def getAllDealObjects(offset, limit):
2077
def getAllDealObjects(offset, limit):
2078
    data = []
2078
    data = []
2079
    collection = get_mongo_connection().Catalog.DealObject
2079
    collection = get_mongo_connection().Catalog.DealObject
2080
    cursor = collection.find({}).skip(offset).limit(limit)
2080
    cursor = collection.find({}).skip(offset).limit(limit)
2081
    for val in cursor:
2081
    for val in cursor:
2082
        data.append(val['_id'],val['name'])
2082
        data.append({'_id':val['_id'],'name':val['name']})
2083
    return data
2083
    return data
-
 
2084
 
-
 
2085
def deleteDealObject(id):
-
 
2086
    try:
-
 
2087
        get_mongo_connection().Catalog.DealObject.remove({'_id':id})
-
 
2088
        return {1:"Deal Object deleted"}
-
 
2089
    except:
-
 
2090
        return {0:"Error in deleting object"}
2084
    
2091
    
2085
    
2092
    
2086
 
2093
 
2087
def main():
2094
def main():
2088
    data = {'hello':"ya"}
2095
    data = {'hello':"ya"}