diff options
| author | Russell Keith-Magee <russell@keith-magee.com> | 2010-10-11 12:20:07 +0000 |
|---|---|---|
| committer | Russell Keith-Magee <russell@keith-magee.com> | 2010-10-11 12:20:07 +0000 |
| commit | 1070c57b83efdfd4fbed09280fcdaafc6d9c1a81 (patch) | |
| tree | 93b5721fe4e0664b993dd0d0b1dee544df304b22 /django/contrib/admin | |
| parent | 5e5be2c44caaae3192a9f8ae1ce0adc0da3d8c4d (diff) | |
Fixed #14436 -- Escalated 1.2 PendingDeprecationWarnings to DeprecationWarnings, and removed 1.1 deprecated code.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14138 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/contrib/admin')
| -rw-r--r-- | django/contrib/admin/sites.py | 75 |
1 files changed, 0 insertions, 75 deletions
diff --git a/django/contrib/admin/sites.py b/django/contrib/admin/sites.py index d0d6473a34..45de459631 100644 --- a/django/contrib/admin/sites.py +++ b/django/contrib/admin/sites.py @@ -456,81 +456,6 @@ class AdminSite(object): context_instance=context_instance ) - def root(self, request, url): - """ - DEPRECATED. This function is the old way of handling URL resolution, and - is deprecated in favor of real URL resolution -- see ``get_urls()``. - - This function still exists for backwards-compatibility; it will be - removed in Django 1.3. - """ - import warnings - warnings.warn( - "AdminSite.root() is deprecated; use include(admin.site.urls) instead.", - DeprecationWarning - ) - - # - # Again, remember that the following only exists for - # backwards-compatibility. Any new URLs, changes to existing URLs, or - # whatever need to be done up in get_urls(), above! - # - - if request.method == 'GET' and not request.path.endswith('/'): - return http.HttpResponseRedirect(request.path + '/') - - if settings.DEBUG: - self.check_dependencies() - - # Figure out the admin base URL path and stash it for later use - self.root_path = re.sub(re.escape(url) + '$', '', request.path) - - url = url.rstrip('/') # Trim trailing slash, if it exists. - - # The 'logout' view doesn't require that the person is logged in. - if url == 'logout': - return self.logout(request) - - # Check permission to continue or display login form. - if not self.has_permission(request): - return self.login(request) - - if url == '': - return self.index(request) - elif url == 'password_change': - return self.password_change(request) - elif url == 'password_change/done': - return self.password_change_done(request) - elif url == 'jsi18n': - return self.i18n_javascript(request) - # URLs starting with 'r/' are for the "View on site" links. - elif url.startswith('r/'): - from django.contrib.contenttypes.views import shortcut - return shortcut(request, *url.split('/')[1:]) - else: - if '/' in url: - return self.model_page(request, *url.split('/', 2)) - else: - return self.app_index(request, url) - - raise http.Http404('The requested admin page does not exist.') - - def model_page(self, request, app_label, model_name, rest_of_url=None): - """ - DEPRECATED. This is the old way of handling a model view on the admin - site; the new views should use get_urls(), above. - """ - from django.db import models - model = models.get_model(app_label, model_name) - if model is None: - raise http.Http404("App %r, model %r, not found." % (app_label, model_name)) - try: - admin_obj = self._registry[model] - except KeyError: - raise http.Http404("This model exists but has not been registered with the admin site.") - return admin_obj(request, rest_of_url) - model_page = never_cache(model_page) - # This global object represents the default admin site, for the common case. # You can instantiate AdminSite in your own code to create a custom admin site. site = AdminSite() |
