î
ªÍ X°  ã               @   sL   d  d l  m Z d  d l m Z d  d l m Z d d „  Z d d „  Z d S)	é    )Úwraps)Úpatch_vary_headers)Úavailable_attrsc                 s   ‡  f d d †  } | S)a  
    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                s1   t  ˆ  d t ˆ  ƒ ƒ‡  ‡ f d d †  ƒ } | S)NÚassignedc                 s    ˆ  |  | Ž  } t  | ˆ ƒ | S)N)r   )ÚargsÚkwargsÚresponse)ÚfuncÚheaders© úJ/home/ubuntu/projects/ifolica/build/django/django/views/decorators/vary.pyÚ
inner_func   s    z6vary_on_headers.<locals>.decorator.<locals>.inner_func)r   r   )r	   r   )r
   )r	   r   Ú	decorator   s    -z"vary_on_headers.<locals>.decoratorr   )r
   r   r   )r
   r   Úvary_on_headers   s    r   c                s.   t  ˆ  d t ˆ  ƒ ƒ‡  f d d †  ƒ } | S)zÙ
    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)NÚCookie)zCookie)r   )r   r   r   )r	   r   r   r   %   s    z"vary_on_cookie.<locals>.inner_func)r   r   )r	   r   r   )r	   r   Úvary_on_cookie   s    	*r   N)Ú	functoolsr   Zdjango.utils.cacher   Zdjango.utils.decoratorsr   r   r   r   r   r   r   Ú<module>   s   