File manager - Edit - /usr/local/CyberCP/lib/python3.10/site-packages/django/contrib/gis/sitemaps/__pycache__/kml.cpython-310.pyc
Back
o �h � @ 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 �R/usr/local/CyberCP/lib/python3.10/site-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. ���� �zKMLSitemap._build_kml_sources� c C s* t j| |||d�}|D ]}| j|d<