File: //usr/lib/python3/dist-packages/django/contrib/gis/sitemaps/__pycache__/kml.cpython-310.pyc
o
�af � @ s` d dl mZ d dlmZ d dlmZ d dlmZ d dlm Z G dd� de�Z
G dd � d e
�Zd
S )� )�apps)�
GeometryField)�Sitemap)�models)�reversec @ s@ e Zd ZdZdZddd�Zdd� Zdd d
�Zdd� Zd
d� Z dS )�
KMLSitemapz1
A minimal hook to produce KML sitemaps.
�kmlNc C s | � |�| _d S �N)�_build_kml_sources� locations)�selfr � r
�A/usr/lib/python3/dist-packages/django/contrib/gis/sitemaps/kml.py�__init__ s zKMLSitemap.__init__c C s� g }|du r
t �� }|D ]=}t|tjj�r/|jjD ]}t|t�r-|� |jj
|jj|jf� qqt|t
tf�rFt|�dkr@td��|� |� qtd��|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�fieldr
r
r r
s&