Ñò
÷L¼Lc           @   s’   d  d k  l Z l Z d  d k l Z l Z l Z l Z d  d k l	 Z	 d  d k
 Z
 e
 i d e ƒ e	 d ƒ Z d d d „ Z e e d „ Z d S(	   iÿÿÿÿ(   t   loadert   RequestContext(   t   HttpResponset   HttpResponseRedirectt   HttpResponsePermanentRedirectt   HttpResponseGone(   t	   getLoggerNsQ   Function-based generic views have been deprecated; use class-based views instead.s   django.requestc   
      K   s    | d j o
 h  } n h | d 6} xB | i ƒ  D]4 \ } } t | ƒ o | ƒ  | | <q1 | | | <q1 Wt |  | ƒ } t i | ƒ }	 t |	 i | ƒ d | ƒS(   sg   
    Render a given template with any extra URL parameters in the context as
    ``{{ params }}``.
    t   paramst   mimetypeN(   t   Nonet   itemst   callableR   R    t   get_templateR   t   render(
   t   requestt   templatet   extra_contextR   t   kwargst
   dictionaryt   keyt   valuet   ct   t(    (    sE   /usr/local/lib/python2.6/dist-packages/django/views/generic/simple.pyt   direct_to_template   s     
 c         K   sŸ   |  i  d } | o( | o! | d j	 o d | | f } n | d j	 o# | o t p t } | | | ƒ St i d |  i d h d d 6|  d 6ƒt ƒ  Sd S(	   sï  
    Redirect to a given URL.

    The given url may contain dict-style string formatting, which will be
    interpolated against the params in the URL.  For example, to redirect from
    ``/foo/<id>/`` to ``/bar/<id>/``, you could use the following URLconf::

        urlpatterns = patterns('',
            ('^foo/(?P<id>\d+)/$', 'django.views.generic.simple.redirect_to', {'url' : '/bar/%(id)s/'}),
        )

    If the given url is ``None``, a HttpResponseGone (410) will be issued.

    If the ``permanent`` argument is False, then the response will have a 302
    HTTP status code. Otherwise, the status code will be 301.

    If the ``query_string`` argument is True, then the GET query string
    from the request is appended to the URL.

    t   QUERY_STRINGs   %s?%ss   Gone: %st   extraiš  t   status_codeR   N(   t   METAR	   R   R   t   loggert   warningt   pathR   (   R   t   urlt	   permanentt   query_stringR   t   argst   klass(    (    sE   /usr/local/lib/python2.6/dist-packages/django/views/generic/simple.pyt   redirect_to   s    (   t   django.templateR    R   t   django.httpR   R   R   R   t   django.utils.logR   t   warningst   warnt   PendingDeprecationWarningR   R	   R   t   Truet   FalseR$   (    (    (    sE   /usr/local/lib/python2.6/dist-packages/django/views/generic/simple.pyt   <module>   s   "