| Server IP : 217.160.0.135 / Your IP : 216.73.217.85 Web Server : Apache System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64 User : sws1074145052 ( 1074145052) PHP Version : 8.3.32 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /usr/lib/python3/dist-packages/django/contrib/gis/db/models/__pycache__/ |
Upload File : |
�
�|�e2 � �2 � d Z ddlmZ G d� de� � ZdS )a
The SpatialProxy object allows for lazy-geometries and lazy-rasters. The proxy
uses Python descriptors for instantiating and setting Geometry or Raster
objects corresponding to geographic model fields.
Thanks to Robert Coup for providing this functionality (see #4322).
� )�DeferredAttributec �2 � � e Zd Zd� fd� Zd� fd� Zd� Z� xZS )�SpatialProxyNc �j �� || _ |p|| _ t � � � |� � dS )zy
Initialize on the given Geometry or Raster class (not an instance)
and the corresponding field.
N)�_klass�
_load_func�super�__init__)�self�klass�field� load_func� __class__s ��D/usr/lib/python3/dist-packages/django/contrib/gis/db/models/proxy.pyr
zSpatialProxy.__init__ s6 �� �
���#�,�u���
����������� c �L �� |�| S |j | j j }n2# t $ r% t � � � ||� � }Y nw xY wt
|| j � � r|}n;|�|dk rd}n0| � |� � }t || j j |� � |S )z�
Retrieve the geometry or raster, initializing it using the
corresponding class specified during initialization and the value of
the field. Currently, GEOS or OGR geometries as well as GDALRasters are
supported.
N� )
�__dict__r
�attname�KeyErrorr �__get__�
isinstancer r �setattr)r �instance�cls� geo_value�geo_objr s �r r zSpatialProxy.__get__ s� �� � ���K� 7� �)�$�*�*<�=�I�I��� 7� 7� 7�������#�6�6�I�I�I� 7���� �i���-�-� ;��G�G���Y�"�_�_��G�G� �o�o�i�0�0�G��H�d�j�0�'�:�:�:��s � �,A�
Ac
� � | j j }|dk r%|�"t |t t | j f� � rn|t || j � � r|j �| j j |_ nN|�t |t t f� � rn/t d|j j
�d|�dt |� � ��� � �||j | j j
<