@@ -0,0 +1,1464 @@
+#!/usr/bin/python2.5%0A#%0A# Copyright 2009 the Melange authors.%0A#%0A# Licensed under the Apache License, Version 2.0 (the %22License%22);%0A# you may not use this file except in compliance with the License.%0A# You may obtain a copy of the License at%0A#%0A#   http://www.apache.org/licenses/LICENSE-2.0%0A#%0A# Unless required by applicable law or agreed to in writing, software%0A# distributed under the License is distributed on an %22AS IS%22 BASIS,%0A# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A# See the License for the specific language governing permissions and%0A# limitations under the License.%0A%0A%22%22%22Middleware to set up and empty the value store.%0A%22%22%22%0A%0A__authors__ = %5B%0A  '%22Sverre Rabbelier%22 %3Csverre@rabbelier.nl%3E',%0A  %5D%0A%0A%0Afrom soc.modules import callback%0A%0A%0Aclass ValueStoreMiddleware(object):%0A  %22%22%22Middleware class to set up and empty the value store.%0A  %22%22%22%0A%0A  def start(self, request):%0A    %22%22%22Sets up the value store.%0A%0A    Args:%0A      request: a Django HttpRequest object%0A    %22%22%22%0A%0A    core = callback.getCore()%0A    core.startNewRequest(request)%0A%0A  def end(self, request):%0A    %22%22%22Empties the value store.%0A%0A    Args:%0A      request: a Django HttpRequest object%0A    %22%22%22%0A%0A    core = callback.getCore()%0A    core.endRequest(request)%0A%0A  def process_request(self, request):%0A    self.start(request)%0A%0A  def process_response(self, request, response):%0A    self.end(request)%0A    return response%0A%0A  def process_exception(self, request, exception):%0A    self.end(request)%0A

Add ValueStoreMiddleware