Ńň
żĂwLc        
   @   sŽ   d  d k  l Z d  d k l Z l Z d  d k l Z d  d k l Z l	 Z	 d  d k
 l Z d  d k l Z d  d k l Z d  d k l Z d	 Z d
   Z e d    Z d S(   i˙˙˙˙(   t   FlatPage(   t   loadert   RequestContext(   t   get_object_or_404(   t   HttpResponset   HttpResponseRedirect(   t   settings(   t   populate_xheaders(   t	   mark_safe(   t   csrf_protects   flatpages/default.htmlc         C   ss   | i  d  o t i o t d |  i  S| i d  p d | } n t t d | d t i } t	 |  |  S(   s)  
    Public interface to the flat page view.

    Models: `flatpages.flatpages`
    Templates: Uses the template defined by the ``template_name`` field,
        or `flatpages/default.html` if template_name is not defined.
    Context:
        flatpage
            `flatpages.flatpages` object
    t   /s   %s/t
   url__exactt   sites__id__exact(
   t   endswithR   t   APPEND_SLASHR   t   patht
   startswithR   R    t   SITE_IDt   render_flatpage(   t   requestt   urlt   f(    (    sH   /usr/local/lib/python2.6/dist-packages/django/contrib/flatpages/views.pyt   flatpage   s    c         C   s×   | i  o/ |  i i   o d d k l } | |  i  S| i o t i | i t	 f  } n t i
 t	  } t | i  | _ t | i  | _ t |  h | d 6 } t | i |   } t |  | t | i  | S(   s3   
    Internal interface to the flat page view.
    i˙˙˙˙(   t   redirect_to_loginR   (   t   registration_requiredt   usert   is_authenticatedt   django.contrib.auth.viewsR   R   t   template_nameR   t   select_templatet   DEFAULT_TEMPLATEt   get_templateR   t   titlet   contentR   R   t   renderR   R    t   id(   R   R   R   t   tt   ct   response(    (    sH   /usr/local/lib/python2.6/dist-packages/django/contrib/flatpages/views.pyR   &   s    
	N(   t   django.contrib.flatpages.modelsR    t   django.templateR   R   t   django.shortcutsR   t   django.httpR   R   t   django.confR   t   django.core.xheadersR   t   django.utils.safestringR   t   django.views.decorators.csrfR	   R   R   R   (    (    (    sH   /usr/local/lib/python2.6/dist-packages/django/contrib/flatpages/views.pyt   <module>   s   
	