#NEWLINE# def class_decorator( decorator ) : #NEWLINE# #INDENT# "\n    usage:\n    in views.py\n\n        from django.views.decorators.cache import cache_control\n        from django.views.generic import View\n        @class_decorator(cache_control(max_age=60))\n        class MyView(View):\n            filename = 'templatefile'\n            def content(self, request):\n                ...\n    " #NEWLINE# def inner( cls ) : #NEWLINE# #INDENT# orig_dispatch = cls . dispatch #NEWLINE# @ method_decorator ( decorator ) #NEWLINE# def new_dispatch( self , request , * args , **kwargs ) : #NEWLINE# #INDENT# return orig_dispatch ( self , request , * args , ** kwargs ) #NEWLINE# #UNINDENT# cls . dispatch = new_dispatch #NEWLINE# return cls #NEWLINE# #UNINDENT# return decorator