diff options
| author | Sergey Parkhomenko <s.y.parkhomenko@gmail.com> | 2014-12-11 00:25:05 +0200 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2014-12-11 13:56:56 -0500 |
| commit | 059c9ab24c41e1460fd8b7af65ea8d5f80f1aa82 (patch) | |
| tree | 130b9b8169d235dd139fb446ffd1ccd82004efc3 /docs | |
| parent | d4e449d73029dd512acb5f156ee5b4e93189e7b9 (diff) | |
Fixed #23977 -- Added setdefault() method to HttpResponse
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/request-response.txt | 6 | ||||
| -rw-r--r-- | docs/releases/1.8.txt | 4 |
2 files changed, 10 insertions, 0 deletions
diff --git a/docs/ref/request-response.txt b/docs/ref/request-response.txt index 3ae8510ce8..3f4d371df5 100644 --- a/docs/ref/request-response.txt +++ b/docs/ref/request-response.txt @@ -708,6 +708,12 @@ Methods Returns ``True`` or ``False`` based on a case-insensitive check for a header with the given name. +.. method:: HttpResponse.setdefault(header, value) + + .. versionadded:: 1.8 + + Sets a header unless it has already been set. + .. method:: HttpResponse.set_cookie(key, value='', max_age=None, expires=None, path='/', domain=None, secure=None, httponly=False) Sets a cookie. The parameters are the same as in the diff --git a/docs/releases/1.8.txt b/docs/releases/1.8.txt index 6635d625bb..5ab42996ab 100644 --- a/docs/releases/1.8.txt +++ b/docs/releases/1.8.txt @@ -483,6 +483,10 @@ Requests and Responses like :meth:`~django.http.HttpResponse.getvalue` so that instances can be used as stream objects. +* The new :meth:`HttpResponse.setdefault() + <django.http.HttpResponse.setdefault>` method allows setting a header unless + it has already been set. + Tests ^^^^^ |
