ó
;ÏOc           @   sF   d  d l  m Z d  d l m Z d  d l m Z d „  Z d „  Z d S(   iÿÿÿÿ(   t   wraps(   t   patch_vary_headers(   t   available_attrsc             s   ‡  f d †  } | S(   s  
    A view decorator that adds the specified headers to the Vary header of the
    response. Usage:

       @vary_on_headers('Cookie', 'Accept-language')
       def index(request):
           ...

    Note that the header names are not case-sensitive.
    c            s.   t  ˆ  d t ˆ  ƒ ƒ‡ ‡  f d †  ƒ } | S(   Nt   assignedc             s    ˆ |  | Ž  } t  | ˆ  ƒ | S(   N(   R   (   t   argst   kwargst   response(   t   headerst   func(    s5   ../Django//lib/python/django/views/decorators/vary.pyt
   inner_func   s    (   R    R   (   R   R	   (   R   (   R   s5   ../Django//lib/python/django/views/decorators/vary.pyt	   decorator   s    *(    (   R   R
   (    (   R   s5   ../Django//lib/python/django/views/decorators/vary.pyt   vary_on_headers   s    c            s+   t  ˆ  d t ˆ  ƒ ƒ‡  f d †  ƒ } | S(   sÙ   
    A view decorator that adds "Cookie" to the Vary header of a response. This
    indicates that a page's contents depends on cookies. Usage:

        @vary_on_cookie
        def index(request):
            ...
    R   c             s    ˆ  |  | Ž  } t  | d ƒ | S(   Nt   Cookie(   R   (   R   (   R   R   R   (   R   (    s5   ../Django//lib/python/django/views/decorators/vary.pyR	   "   s    (   R    R   (   R   R	   (    (   R   s5   ../Django//lib/python/django/views/decorators/vary.pyt   vary_on_cookie   s    	'N(   t	   functoolsR    t   django.utils.cacheR   t   django.utils.decoratorsR   R   R   (    (    (    s5   ../Django//lib/python/django/views/decorators/vary.pyt   <module>   s   	