ó
:ÏOc           @   s:   d  d l  m Z d  d l m Z d e f d „  ƒ  YZ d S(   iÿÿÿÿ(   t   urlresolvers(   t   Sitemapt   GeoRSSSitemapc           B   s;   e  Z d  Z d d „ Z d d d „ Z d „  Z d „  Z RS(   s>   
    A minimal hook to produce sitemaps for GeoRSS feeds.
    c         C   s–   | |  _  g  |  _ | d k r' i  } n  xh | j ƒ  D]Z } | j | t ƒ r~ x? | | D]  } |  j j d | | f ƒ qW Wq4 |  j j | ƒ q4 Wd S(   sÃ  
        This sitemap object initializes on a feed dictionary (as would be passed
        to `django.contrib.gis.views.feed`) and a slug dictionary.
        If the slug dictionary is not defined, then it's assumed the keys provide
        the URL parameter to the feed.  However, if you have a complex feed (e.g.,
        you override `get_object`, then you'll need to provide a slug dictionary.
        The slug dictionary should have the same keys as the feed dictionary, but
        each value in the slug dictionary should be a sequence of slugs that may
        be used for valid feeds.  For example, let's say we have a feed that
        returns objects for a specific ZIP code in our feed dictionary:

            feed_dict = {'zipcode' : ZipFeed}

        Then we would use a slug dictionary with a list of the zip code slugs
        corresponding to feeds you want listed in the sitemap:

            slug_dict = {'zipcode' : ['77002', '77054']}
        s   %s/%sN(   t	   feed_dictt	   locationst   Nonet   keyst   gett   Falset   append(   t   selfR   t	   slug_dictt   sectiont   slug(    (    s;   ../Django//lib/python/django/contrib/gis/sitemaps/georss.pyt   __init__   s    		 	!i   c         C   s:   t  j |  d | d | ƒ} x | D] } d | d <q" W| S(   s}   
        This method is overrridden so the appropriate `geo_format` attribute
        is placed on each URL element.
        t   paget   sitet   georsst
   geo_format(   R   t   get_urls(   R
   R   R   t   urlst   url(    (    s;   ../Django//lib/python/django/contrib/gis/sitemaps/georss.pyR   '   s     c         C   s   |  j  S(   N(   R   (   R
   (    (    s;   ../Django//lib/python/django/contrib/gis/sitemaps/georss.pyt   items0   s    c         C   s   t  j d d | f ƒS(   Ns   django.contrib.gis.views.feedt   args(   R    t   reverse(   R
   t   obj(    (    s;   ../Django//lib/python/django/contrib/gis/sitemaps/georss.pyt   location3   s    N(   t   __name__t
   __module__t   __doc__R   R   R   R   R   (    (    (    s;   ../Django//lib/python/django/contrib/gis/sitemaps/georss.pyR      s
   		N(   t   django.coreR    t   django.contrib.sitemapsR   R   (    (    (    s;   ../Django//lib/python/django/contrib/gis/sitemaps/georss.pyt   <module>   s   