Is there a reason for the middleware being old-style classes? If
middleware was defined as Middleware(object) we could extend it like
this without modifying Django's source:

class MyCacheMiddleware(CacheMiddleware):

    def process_request(self, request):

        if check_request(request):
            request._cache_update_cache = False
            return None

        return super(MyCacheMiddleware, self).process_request(request)

Andreas

Reply via email to