
    Dvg
                     z    d dl mZ d dlmZ d dlmZ d dlmZ d dlm	Z	  G d de          Z
 G d d	e
          Zd
S )    )apps)GeometryField)Sitemap)models)reversec                   8    e Zd ZdZdZd
dZd ZddZd Zd	 Z	dS )
KMLSitemapz1
    A minimal hook to produce KML sitemaps.
    kmlNc                 :    |                      |          | _        d S N)_build_kml_sources	locations)selfr   s     \/var/www/pixelcanvas.ch/venv/lib/python3.11/site-packages/django/contrib/gis/sitemaps/kml.py__init__zKMLSitemap.__init__   s     00;;    c                    g }|t          j                    }|D ]}t          |t          j        j                  rV|j        j        D ]H}t          |t                    r1|	                    |j        j
        |j        j        |j        f           Iwt          |t          t          f          r8t          |          dk    rt!          d          |	                    |           t#          d          |S )z
        Go through the given sources and return a 3-tuple of the application
        label, module name, and field name of every GeometryField encountered
        in the sources.

        If no sources are provided, then all models.
        N   z?Must specify a 3-tuple of (app_label, module_name, field_name).z)KML Sources must be a model or a 3-tuple.)r   
get_models
isinstancer   base	ModelBase_metafieldsr   append	app_label
model_namenamelisttuplelen
ValueError	TypeError)r   sourceskml_sourcessourcefields        r   r   zKMLSitemap._build_kml_sources   s    ?o''G 	M 	MF&&+"788 M#\0  E!%77 #** & 6 & 7 %
   FT5M22 Mv;;!##$'   ""6**** KLLLr      c                 T    t          j        | |||          }|D ]}| j        |d<   |S )z|
        This method is overridden so the appropriate `geo_format` attribute
        is placed on each URL element.
        )pagesiteprotocol
geo_format)r   get_urlsr-   )r   r*   r+   r,   urlsurls         r   r.   zKMLSitemap.get_urls5   s@    
 4dXNNN 	0 	0C $Cr   c                     | j         S r   )r   )r   s    r   itemszKMLSitemap.items?   s
    ~r   c                 `    t          d| j        z  |d         |d         |d         d          S )Nz$django.contrib.gis.sitemaps.views.%sr   r(      )labelmodel
field_name)kwargs)r   r-   )r   objs     r   locationzKMLSitemap.locationB   sB    2T_DQQ!!f 
 
 
 	
r   r   )r(   NN)
__name__
__module____qualname____doc__r-   r   r   r.   r2   r:    r   r   r	   r	      s{          J< < < <
  B     
 
 
 
 
r   r	   c                       e Zd ZdZdS )
KMZSitemapkmzN)r;   r<   r=   r-   r?   r   r   rA   rA   M   s        JJJr   rA   N)django.appsr   django.contrib.gis.db.modelsr   django.contrib.sitemapsr   	django.dbr   django.urlsr   r	   rA   r?   r   r   <module>rH      s          6 6 6 6 6 6 + + + + + +            B
 B
 B
 B
 B
 B
 B
 B
J         r   