Subversion Repositories SmartDukaan

Rev

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

Rev 3924 Rev 4024
Line 1213... Line 1213...
1213
            # use the opener to fetch a URL
1213
            # use the opener to fetch a URL
1214
            res = opener.open(top_level_url + "cache-admin/HomePageSnippets?_method=delete")
1214
            res = opener.open(top_level_url + "cache-admin/HomePageSnippets?_method=delete")
1215
            print "Successfully cleared home page cache" + res.read()
1215
            print "Successfully cleared home page cache" + res.read()
1216
    except:
1216
    except:
1217
        print "Unable to clear cache, still should continue with other operations"
1217
        print "Unable to clear cache, still should continue with other operations"
-
 
1218
        
-
 
1219
def get_pending_orders_inventory():
-
 
1220
    """
-
 
1221
    Returns a list of inventory stock for items for which there are pending orders.
-
 
1222
    """
-
 
1223
    pending_items_inventory = session.query(CurrentInventorySnapshot.item_id, func.sum(CurrentInventorySnapshot.availibility), func.sum(CurrentInventorySnapshot.reserved)).group_by(CurrentInventorySnapshot.item_id).having(func.sum(CurrentInventorySnapshot.reserved) > 0).all()
-
 
1224
    return pending_items_inventory
1218
    
1225
    
1219
def close_session():
1226
def close_session():
1220
    if session.is_active:
1227
    if session.is_active:
1221
        print "session is active. closing it."
1228
        print "session is active. closing it."
1222
        session.close()
1229
        session.close()