
    h
                     l    S SK Jr  S SKJr  S SKJr  S SKJr  S SKJ	r	   " S S\5      r
 " S S	\
5      rg
)    )apps)GeometryField)Sitemap)models)reversec                   B    \ rS rSrSrSrSS jrS rSS jrS r	S	 r
S
rg)
KMLSitemap   z)
A minimal hook to produce KML sitemaps.
kmlNc                 0    U R                  U5      U l        g N)_build_kml_sources	locations)selfr   s     Q/var/www/html/env/lib/python3.13/site-packages/django/contrib/gis/sitemaps/kml.py__init__KMLSitemap.__init__   s     00;    c                 8   / nUc  [         R                  " 5       nU H  n[        U[        R                  R
                  5      (       a|  UR                  R                   H`  n[        U[        5      (       d  M  UR                  UR                  R                  UR                  R                  UR                  45        Mb     M  [        U[        [        45      (       a-  [        U5      S:w  a  [!        S5      eUR                  U5        M  [#        S5      e   U$ )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.
   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   KMLSitemap._build_kml_sources   s     ?oo'GF&&++"7"788#\\00E!%77#** & 6 6 & 7 7 %

 1 FT5M22v;!#$'  ""6* KLL' ( r   c                 `    [         R                  " XX#S9nU H  nU R                  US'   M     U$ )zd
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   r0   KMLSitemap.get_urls5   s3    
 dNC $C r   c                     U R                   $ r   r   )r   s    r   itemsKMLSitemap.items?   s    ~~r   c                 J    [        SU R                  -  US   US   US   S.S9$ )Nz$django.contrib.gis.sitemaps.views.%sr         )labelmodel
field_name)kwargs)r   r/   )r   objs     r   locationKMLSitemap.locationB   s5    2T__DQQ!!f
 	
r   r5   r   )r9   NN)__name__
__module____qualname____firstlineno____doc__r/   r   r   r0   r6   r@   __static_attributes__ r   r   r	   r	      s(     J<
B
r   r	   c                       \ rS rSrSrSrg)
KMZSitemapM   kmzrH   N)rB   rC   rD   rE   r/   rG   rH   r   r   rJ   rJ   M   s    Jr   rJ   N)django.appsr   django.contrib.gis.db.modelsr   django.contrib.sitemapsr   	django.dbr   django.urlsr   r	   rJ   rH   r   r   <module>rR      s/     6 +  B
 B
J r   