diff options
| author | Adrian Holovaty <adrian@holovaty.com> | 2006-06-20 03:48:31 +0000 |
|---|---|---|
| committer | Adrian Holovaty <adrian@holovaty.com> | 2006-06-20 03:48:31 +0000 |
| commit | 136752ca9a87be908f9ec1e398bbd56b0c75222c (patch) | |
| tree | f8ba00ebfda2cb7bd0c559ac3064407bcbc68330 /django/http | |
| parent | a09682fd6376159f81de9d6dc8c86ebd4e0b6513 (diff) | |
Added 'method' attribute to HttpRequest objects
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3164 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/http')
| -rw-r--r-- | django/http/__init__.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/django/http/__init__.py b/django/http/__init__.py index 178510c94c..efc1286f6d 100644 --- a/django/http/__init__.py +++ b/django/http/__init__.py @@ -12,11 +12,12 @@ except ImportError: class Http404(Exception): pass -class HttpRequest(object): # needs to be new-style class because subclasses define "property"s +class HttpRequest(object): "A basic HTTP request" def __init__(self): self.GET, self.POST, self.COOKIES, self.META, self.FILES = {}, {}, {}, {}, {} self.path = '' + self.method = None def __repr__(self): return '<HttpRequest\nGET:%s,\nPOST:%s,\nCOOKIES:%s,\nMETA:%s>' % \ @@ -282,7 +283,7 @@ class HttpResponseServerError(HttpResponse): self.status_code = 500 def get_host(request): - """Gets the HTTP host from the environment or request headers.""" + "Gets the HTTP host from the environment or request headers." host = request.META.get('HTTP_X_FORWARDED_HOST', '') if not host: host = request.META.get('HTTP_HOST', '') |
