magic-removal: Moved django.exceptions.Http404 to django.http.Http404 and updated references.

git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@1917 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Joseph Kocherhans 2006-01-11 21:57:59 +00:00
parent 1c989f59d4
commit 7ff20316f0
19 changed files with 33 additions and 28 deletions

View File

@ -3,7 +3,8 @@ from django.conf import settings
from django.contrib.admin.views.decorators import staff_member_required
from django.db import models
from django.core.extensions import DjangoContext, render_to_response
from django.core.exceptions import Http404, ViewDoesNotExist
from django.core.exceptions import ViewDoesNotExist
from django.http import Http404
from django.core import template, urlresolvers
from django.contrib.admin import utils
from django.contrib.sites.models import Site

View File

@ -4,7 +4,8 @@ from django.contrib.admin.views.decorators import staff_member_required
from django.core import formfields, template
from django.core.template import loader
from django.db import models
from django.core.exceptions import Http404, ImproperlyConfigured, ObjectDoesNotExist, PermissionDenied
from django.http import Http404
from django.core.exceptions import ImproperlyConfigured, ObjectDoesNotExist, PermissionDenied
from django.core.extensions import DjangoContext as Context
from django.core.extensions import get_object_or_404, render_to_response
from django.utils import dateformat

View File

@ -3,7 +3,8 @@ from django.contrib.admin.views.decorators import staff_member_required
from django.contrib.admin.views.main import get_model_and_app
from django.contrib.admin.views.stages.modify import render_change_form
from django.core import formfields, template
from django.core.exceptions import Http404, ImproperlyConfigured, ObjectDoesNotExist, PermissionDenied
from django.http import Http404
from django.core.exceptions import ImproperlyConfigured, ObjectDoesNotExist, PermissionDenied
from django.core.extensions import DjangoContext as Context
from django.db import models
from django.http import HttpResponse, HttpResponseRedirect

View File

@ -1,6 +1,7 @@
from django.contrib.admin.views.main import get_model_and_app
from django.core import formfields, template
from django.core.exceptions import Http404, ImproperlyConfigured, ObjectDoesNotExist, PermissionDenied
from django.http import Http404
from django.core.exceptions import ImproperlyConfigured, ObjectDoesNotExist, PermissionDenied
from django.core.extensions import DjangoContext as Context
from django.contrib.admin.views.stages.modify import render_change_form
from django.db import models

View File

@ -1,6 +1,7 @@
from django.core import formfields, validators
from django.core.mail import mail_admins, mail_managers
from django.core.exceptions import Http404, ObjectDoesNotExist
from django.http import Http404
from django.core.exceptions import ObjectDoesNotExist
from django.core.extensions import DjangoContext, render_to_response
from django.contrib.auth.models import SESSION_KEY
from django.contrib.comments.models import Comment, FreeComment, PHOTOS_REQUIRED, PHOTOS_OPTIONAL, RATINGS_REQUIRED, RATINGS_OPTIONAL, IS_PUBLIC

View File

@ -1,4 +1,4 @@
from django.core.exceptions import Http404
from django.http import Http404
from django.core.extensions import DjangoContext, render_to_response
from django.models.comments import comments, karma

View File

@ -1,5 +1,5 @@
from django.core.extensions import DjangoContext, render_to_response
from django.core.exceptions import Http404
from django.http import Http404
from django.models.comments import comments, moderatordeletions, userflags
from django.views.decorators.auth import login_required
from django.http import HttpResponseRedirect

View File

@ -1,5 +1,5 @@
from django.contrib.flatpages.views import flatpage
from django.core.extensions import Http404
from django.http import Http404
from django.conf.settings import DEBUG
class FlatpageFallbackMiddleware:

View File

@ -1,6 +1,5 @@
from django.contrib.syndication import feeds
from django.core.exceptions import Http404
from django.http import HttpResponse
from django.http import HttpResponse, Http404
def feed(request, url, feed_dict=None):
if not feed_dict:

View File

@ -1,8 +1,5 @@
"Global Django exceptions"
class Http404(Exception):
pass
class ObjectDoesNotExist(Exception):
"The requested object does not exist"
silent_variable_failure = True

View File

@ -2,10 +2,10 @@
# of MVC. In other words, these functions/classes introduce controlled coupling
# for convenience's sake.
from django.core.exceptions import Http404, ImproperlyConfigured
from django.core.exceptions import ImproperlyConfigured
from django.core.template import Context, loader
from django.conf.settings import TEMPLATE_CONTEXT_PROCESSORS
from django.http import HttpResponse
from django.http import HttpResponse, Http404
_standard_context_processors = None

View File

@ -86,7 +86,7 @@ class BaseHandler:
raise ValueError, "The view %s.%s didn't return an HttpResponse object." % (callback.__module__, callback.func_name)
return response
except exceptions.Http404, e:
except http.Http404, e:
if DEBUG:
return self.get_technical_error_response(request, is404=True, exception=e)
else:

View File

@ -7,7 +7,8 @@ a string) and returns a tuple in this format:
(view_function, function_args, function_kwargs)
"""
from django.core.exceptions import Http404, ImproperlyConfigured, ViewDoesNotExist
from django.http import Http404
from django.core.exceptions import ImproperlyConfigured, ViewDoesNotExist
import re
class Resolver404(Http404):

View File

@ -9,6 +9,9 @@ try:
except ImportError:
from cgi import parse_qsl
class Http404(Exception):
pass
class HttpRequest(object): # needs to be new-style class because subclasses define "property"s
"A basic HTTP request"
def __init__(self):

View File

@ -1,4 +1,4 @@
from django.core.exceptions import Http404, ObjectDoesNotExist
from django.core.exceptions import ObjectDoesNotExist
from django.core.template import Context, loader
from django.contrib.contenttypes.models import ContentType
from django.contrib.sites.models import Site
@ -11,11 +11,11 @@ def shortcut(request, content_type_id, object_id):
content_type = ContentType.objects.get_object(pk=content_type_id)
obj = content_type.get_object_for_this_type(pk=object_id)
except ObjectDoesNotExist:
raise Http404, "Content type %s object %s doesn't exist" % (content_type_id, object_id)
raise http.Http404, "Content type %s object %s doesn't exist" % (content_type_id, object_id)
try:
absurl = obj.get_absolute_url()
except AttributeError:
raise Http404, "%s objects don't have get_absolute_url() methods" % content_type.name
raise http.Http404, "%s objects don't have get_absolute_url() methods" % content_type.name
# Try to figure out the object's domain, so we can do a cross-site redirect
# if necessary.

View File

@ -5,8 +5,8 @@ from django.core import formfields, meta
from django.views.auth.login import redirect_to_login
from django.core.extensions import DjangoContext
from django.core.paginator import ObjectPaginator, InvalidPage
from django.http import HttpResponse, HttpResponseRedirect
from django.core.exceptions import Http404, ObjectDoesNotExist, ImproperlyConfigured
from django.http import Http404, HttpResponse, HttpResponseRedirect
from django.core.exceptions import ObjectDoesNotExist, ImproperlyConfigured
def create_object(request, app_label, module_name, template_name=None,
template_loader=loader, extra_context={}, post_save_redirect=None,

View File

@ -1,9 +1,9 @@
from django.core.template import loader
from django.core.exceptions import Http404, ObjectDoesNotExist
from django.core.exceptions import ObjectDoesNotExist
from django.core.extensions import DjangoContext
from django.core.xheaders import populate_xheaders
from django.models import get_module
from django.http import HttpResponse
from django.http import Http404, HttpResponse
import datetime, time
def archive_index(request, app_label, module_name, date_field, num_latest=15,

View File

@ -1,10 +1,10 @@
from django import models
from django.core.template import loader
from django.http import HttpResponse
from django.http import Http404, HttpResponse
from django.core.xheaders import populate_xheaders
from django.core.extensions import DjangoContext
from django.core.paginator import ObjectPaginator, InvalidPage
from django.core.exceptions import Http404, ObjectDoesNotExist
from django.core.exceptions import ObjectDoesNotExist
def object_list(request, app_label, module_name, paginate_by=None, allow_empty=False,
template_name=None, template_loader=loader, extra_lookup_kwargs={},

View File

@ -3,8 +3,8 @@ import urllib
import posixpath
import mimetypes
from django.core import template_loader
from django.core.exceptions import Http404, ImproperlyConfigured
from django.http import HttpResponse, HttpResponseRedirect
from django.core.exceptions import ImproperlyConfigured
from django.http import Http404, HttpResponse, HttpResponseRedirect
from django.core.template import Template, Context, TemplateDoesNotExist
def serve(request, path, document_root=None, show_indexes=False):