diff options
| author | Adrian Holovaty <adrian@holovaty.com> | 2005-10-31 03:14:57 +0000 |
|---|---|---|
| committer | Adrian Holovaty <adrian@holovaty.com> | 2005-10-31 03:14:57 +0000 |
| commit | cbe24263692641af8908da21d1a2d333100a468a (patch) | |
| tree | 0eda8ead46237b29d9e6aeda3801d15b16ee83b2 /django | |
| parent | fb55717a09fb7f92c76d1af23b2717b7a0610d03 (diff) | |
Made several grammar fixes to cache documentation from [1020]
git-svn-id: http://code.djangoproject.com/svn/django/trunk@1030 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django')
| -rw-r--r-- | django/utils/cache.py | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/django/utils/cache.py b/django/utils/cache.py index 631ea8f08d..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: @@ -49,9 +49,7 @@ def patch_cache_control(response, **kwargs): return t[0] + '=' + str(t[1]) if response.has_header('Cache-Control'): - print response['Cache-Control'] cc = cc_delim_re.split(response['Cache-Control']) - print cc cc = dict([dictitem(el) for el in cc]) else: cc = {} |
