https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/django/contrib/gis/db/models/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/django/contrib/gis/db/models/__pycache__/proxy.cpython-310.pyc
o

3�a2�@s$dZddlmZGdd�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).
�)�DeferredAttributecs4eZdZd�fdd�	Zd�fdd�	Zdd�Z�ZS)	�SpatialProxyNcs ||_|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__��D/usr/lib/python3/dist-packages/django/contrib/gis/db/models/proxy.pyrs
zSpatialProxy.__init__cs�|dur|Sz	|j|jj}Wntyt��||�}Ynwt||j�r*|}|S|dus2|dkr6d}|S|�|�}t	||jj|�|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__�
isinstancerr�setattr)r�instance�cls�	geo_value�geo_objrrrrs ��
�zSpatialProxy.__get__cCs�|jj}|dkr|dust|tt|jf�rn*t||j�r'|jdur&|jj|_n|dus2t|ttf�r3n
td|j	j
|t|�f��||j|jj
<|S)z�
        Retrieve the proxied geometry or raster with the corresponding class
        specified during initialization.

        To set geometries, use values of None, HEXEWKB, or WKT.
        To set rasters, use JSON or dict values.
        �RASTERNz6Cannot set %s SpatialProxy (%s) with value of type: %s)r
�	geom_typer�str�dictr�srid�
memoryview�	TypeErrorr
�__name__�typerr)rr�value�gtyperrr�__set__1s	"

��zSpatialProxy.__set__)N)r"�
__module__�__qualname__rrr&�
__classcell__rrrrrs	rN)�__doc__�django.db.models.query_utilsrrrrrr�<module>s

https://t.me/RX1948 - 2025