#NEWLINE# def admin_view( self , view , cacheable = False ) : #NEWLINE# #INDENT# "\n        Decorator to create an admin view attached to this ``AdminSite``. This\n        wraps the view and provides permission checking by calling\n        ``self.has_permission``.\n\n        You'll want to use this from within ``AdminSite.get_urls()``:\n\n            class MyAdminSite(AdminSite):\n\n                def get_urls(self):\n                    from django.conf.urls import url\n\n                    urls = super(MyAdminSite, self).get_urls()\n                    urls += [\n                        url(r'^my_view/$', self.admin_view(some_view))\n                    ]\n                    return urls\n\n        By default, admin_views are marked non-cacheable using the\n        ``never_cache`` decorator. If the view can be safely cached, set\n        cacheable=True.\n        " #NEWLINE# def inner( request , * args , **kwargs ) : #NEWLINE# #INDENT# if ( ( not self . has_permission ( request ) ) and getattr ( view , 'need_site_permission' , True ) ) : #NEWLINE# #INDENT# return self . create_admin_view ( self . login_view ) ( request , * args , ** kwargs ) #NEWLINE# #UNINDENT# return view ( request , * args , ** kwargs ) #NEWLINE# #UNINDENT# if ( not cacheable ) : #NEWLINE# #INDENT# inner = never_cache ( inner ) #NEWLINE# #UNINDENT# return update_wrapper ( inner , cacheable )