Subversion Repositories SmartDukaan

Rev

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

Rev 20439 Rev 20443
Line 1733... Line 1733...
1733
        get_mongo_connection().Catalog.MasterData.update({'skuBundleId':data['skuBundleId']},{"$set":{'updatedOn':to_java_date(datetime.now())}},multi=True)
1733
        get_mongo_connection().Catalog.MasterData.update({'skuBundleId':data['skuBundleId']},{"$set":{'updatedOn':to_java_date(datetime.now())}},multi=True)
1734
        return {1:"Data updated successfully"}
1734
        return {1:"Data updated successfully"}
1735
    except:
1735
    except:
1736
        return {0:"Data not updated."}
1736
        return {0:"Data not updated."}
1737
 
1737
 
1738
def resetCache(userId):
1738
def resetCache(cache_type, users):
1739
    try:
1739
    if (cache_type == 'deals'):
-
 
1740
        for userId in users.split(','):
1740
        mc.delete(userId)
1741
                mc.delete(userId)
1741
        mc.delete(userId+'_acc')
1742
                mc.delete(userId+'_acc')
1742
        return {1:'Cache cleared.'}
1743
        return {1:'Cache cleared.'}
-
 
1744
    elif (cache_type == 'itemCashBack'):
-
 
1745
        mc.delete('item_cash_back')
-
 
1746
        populateCashBack()
-
 
1747
        return {1:'Cache cleared.'}
1743
    except:
1748
    else:
1744
        return {0:'Unable to clear cache.'}
1749
        {0:'Illegal cache type'}
-
 
1750
 
1745
    
1751
        
1746
def updateCollection(data):
1752
def updateCollection(data):
1747
    try:
1753
    try:
1748
        collection = get_mongo_connection().Catalog[data['class']]
1754
        collection = get_mongo_connection().Catalog[data['class']]
1749
        class_name = data.pop('class')
1755
        class_name = data.pop('class')
1750
        _id = data.pop('oid')
1756
        _id = data.pop('oid')