Ticket #6962: newforms-admin-admindocs.diff

File newforms-admin-admindocs.diff, 966 bytes (added by trbs, 17 years ago)
  • django/contrib/admin/sites.py

    diff -r 29a94447e391 django/contrib/admin/sites.py
    a b  
    124124            return self.password_change_done(request)
    125125        elif url == 'jsi18n':
    126126            return self.i18n_javascript(request)
     127        # urls starting with 'doc/' are for the admindocs
     128        elif url.startswith('doc'):
     129            from django.contrib.admindocs.urls import urlpatterns as _patterns
     130            if url=="doc":
     131                url = ''
     132            else:
     133                url = url[4:]+'/'
     134            for pattern in _patterns:
     135                match = pattern.resolve(url)
     136                if match:
     137                    return match[0](request, *match[1], **match[2])
    127138        # urls starting with 'r/' are for the "show in web" links
    128139        elif url.startswith('r/'):
    129140            from django.views.defaults import shortcut
Back to Top