diff options
| author | Georg Bauer <gb@hugo.westfalen.de> | 2005-11-03 21:29:48 +0000 |
|---|---|---|
| committer | Georg Bauer <gb@hugo.westfalen.de> | 2005-11-03 21:29:48 +0000 |
| commit | e27211a0deae2f1d402537f0ebb64ad4ccf6a4da (patch) | |
| tree | 73ba55f337e0d5c6e4ed39474ab6132879cc3947 /django/utils | |
| parent | 9e724c25236b1e00a36a146e66b5deaa43d2af96 (diff) | |
| parent | cb45fd0ae20597306cd1f877efc99d9bd7cbee98 (diff) | |
i18n: merged to [1054] of trunkarchive/attic/i18n
git-svn-id: http://code.djangoproject.com/svn/django/branches/i18n@1067 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/utils')
| -rw-r--r-- | django/utils/cache.py | 14 | ||||
| -rw-r--r-- | django/utils/httpwrappers.py | 4 |
2 files changed, 9 insertions, 9 deletions
diff --git a/django/utils/cache.py b/django/utils/cache.py index ed6e3f11ea..b36753b558 100644 --- a/django/utils/cache.py +++ b/django/utils/cache.py @@ -22,19 +22,19 @@ from django.conf import settings from django.core.cache import cache cc_delim_re = re.compile(r'\s*,\s*') + def patch_cache_control(response, **kwargs): """ This function patches the Cache-Control header by adding all keyword arguments to it. The transformation is as follows: - - all keyword parameter names are turned to lowercase and - all _ will be translated to - - - if the value of a parameter is True (exatly True, not just a - true value), only the parameter name is added to the header - - all other parameters are added with their value, after applying - str to it. + * All keyword parameter names are turned to lowercase, and underscores + are converted to hyphens. + * If the value of a parameter is True (exactly True, not just a + true value), only the parameter name is added to the header. + * All other parameters are added with their value, after applying + str() to it. """ - def dictitem(s): t = s.split('=',1) if len(t) > 1: diff --git a/django/utils/httpwrappers.py b/django/utils/httpwrappers.py index 5f9362bd24..c1aa9d6ee1 100644 --- a/django/utils/httpwrappers.py +++ b/django/utils/httpwrappers.py @@ -172,9 +172,9 @@ class HttpResponse: return True return False - def set_cookie(self, key, value='', max_age=None, path='/', domain=None, secure=None): + def set_cookie(self, key, value='', max_age=None, expires=None, path='/', domain=None, secure=None): self.cookies[key] = value - for var in ('max_age', 'path', 'domain', 'secure'): + for var in ('max_age', 'path', 'domain', 'secure', 'expires'): val = locals()[var] if val is not None: self.cookies[key][var.replace('_', '-')] = val |
