Subversion Repositories SmartDukaan

Rev

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

Rev 13639 Rev 13642
Line 51... Line 51...
51
    return data
51
    return data
52
 
52
 
53
def addSkuDiscountInfo(data):
53
def addSkuDiscountInfo(data):
54
    collection = get_mongo_connection().Dtr.SkuDiscountInfo
54
    collection = get_mongo_connection().Dtr.SkuDiscountInfo
55
    cursor = collection.find({"sku":data['sku']})
55
    cursor = collection.find({"sku":data['sku']})
56
    if cursor.count > 0:
56
    if cursor.count() > 0:
57
        return {0:"Sku information already present."}
57
        return {0:"Sku information already present."}
58
    else:
58
    else:
59
        collection.insert(data)
59
        collection.insert(data)
60
        return {1:"Data added successfully"}
60
        return {1:"Data added successfully"}
61
 
61
 
Line 68... Line 68...
68
    return data
68
    return data
69
 
69
 
70
def addExceptionalNlc(data):
70
def addExceptionalNlc(data):
71
    collection = get_mongo_connection().Dtr.ExceptionalNlc
71
    collection = get_mongo_connection().Dtr.ExceptionalNlc
72
    cursor = collection.find({"sku":data['sku']})
72
    cursor = collection.find({"sku":data['sku']})
73
    if cursor.count > 0:
73
    if cursor.count() > 0:
74
        return {0:"Sku information already present."}
74
        return {0:"Sku information already present."}
75
    else:
75
    else:
76
        collection.insert(data)
76
        collection.insert(data)
77
        return {1:"Data added successfully"}
77
        return {1:"Data added successfully"}
78
 
78