https://t.me/AnonymousX5
Server : Apache
System : Linux cvar2.toservers.com 3.10.0-962.3.2.lve1.5.73.el7.x86_64 #1 SMP Wed Aug 24 21:31:23 UTC 2022 x86_64
User : njnconst ( 1116)
PHP Version : 8.4.18
Disable Function : NONE
Directory :  /usr/lib64/python2.7/site-packages/django/contrib/gis/db/models/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/lib64/python2.7/site-packages/django/contrib/gis/db/models/fields.pyc
�
r�\c@s9ddlmZddlmZddlmZddlmZddl	m
Z
ddlmZm
Z
ddlmZiad�Zd	efd
��YZdefd��YZd
efd��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZdS(i����(tField(tSQLEvaluator(t
ugettext_lazy(tforms(t
GeometryProxy(tGeometrytGeometryException(tsixcCs�y|jj�}Wntk
r'dSX|jtkrGit|j<n|t|jkr�|jj|j�jd|�}|j	\}}|j
|j�}|||ft|j|<nt|j|S(s�
    Returns the units, unit name, and spheroid WKT associated with the
    given SRID from the `spatial_ref_sys` (or equivalent) spatial database
    table for the given database connection.  These results are cached.
    tsridN(NNN(topstspatial_ref_systNotImplementedErrortNonetaliast_srid_cachetobjectstusingtgettunitstget_spheroidtwkt(Rt
connectiont
SpatialRefSystsrRt
units_nametspheroid((sE/tmp/pip-install-XxeQeY/django/django/contrib/gis/db/models/fields.pyt
get_srid_infos
!t
GeometryFieldcBs�eZdZdZejZdZed�Z	ddeded�Z
d�Zd�Zd	�Zd
�Zd�Zd�Zd
�Zd�Zd�Zd�Zd�Zed�Zd�Zd�Zd�ZRS(sFThe base GIS field -- maps to the OpenGIS Specification Geometry type.tGEOMETRYsDecimal Degreetdegreei�icKsr||_||_||_||d<||_|jdd
�|_|jdd�|_tt|�j	|�d	S(s�
        The initialization function for geometry fields.  Takes the following
        as keyword arguments:

        srid:
         The spatial reference system identifier, an OGC standard.
         Defaults to 4326 (WGS84).

        spatial_index:
         Indicates whether to create a spatial index.  Defaults to True.
         Set this instead of 'db_index' for geographic fields since index
         creation is different for geometry columns.

        dim:
         The number of dimensions for this geometry.  Defaults to 2.

        extent:
         Customize the extent, in a 4-tuple of WGS 84 coordinates, for the
         geometry field entry in the `USER_SDO_GEOM_METADATA` table.  Defaults
         to (-180.0, -90.0, 180.0, 90.0).

        tolerance:
         Define the tolerance, in meters, to use for the geometry field
         entry in the `USER_SDO_GEOM_METADATA` table.  Defaults to 0.05.
        tverbose_nametextentg�f�g�V�g�f@g�V@t	toleranceg�������?N(g�f�g�V�g�f@g�V@(
t
spatial_indexRtdimt	geographytpopt_extentt
_tolerancetsuperRt__init__(tselfRRR!R"R#tkwargs((sE/tmp/pip-install-XxeQeY/django/django/contrib/gis/db/models/fields.pyR(6s			
	cCs(t|j|�\|_|_|_dS(N(RRt_unitst_units_namet	_spheroid(R)R((sE/tmp/pip-install-XxeQeY/django/django/contrib/gis/db/models/fields.pyt_get_srid_infolscCs&t|d�s|j|�n|jS(NR-(thasattrR.R-(R)R((sE/tmp/pip-install-XxeQeY/django/django/contrib/gis/db/models/fields.pyRpscCs&t|d�s|j|�n|jS(NR+(R/R.R+(R)R((sE/tmp/pip-install-XxeQeY/django/django/contrib/gis/db/models/fields.pyRuscCs&t|d�s|j|�n|jS(NR,(R/R.R,(R)R((sE/tmp/pip-install-XxeQeY/django/django/contrib/gis/db/models/fields.pyRzscCs|j|�|jkS(s�
        Returns true if this field's SRID corresponds with a coordinate
        system that uses non-projected units (e.g., latitude/longitude).
        (Rtgeodetic_units(R)R((sE/tmp/pip-install-XxeQeY/django/django/contrib/gis/db/models/fields.pytgeodetic�scCs|jj|||�S(s�
        Returns a distance number in units of the field.  For example, if
        `D(km=1)` was passed in and the units of the field were in meters,
        then 1000 would be returned.
        (R	tget_distance(R)tvaluetlookup_typeR((sE/tmp/pip-install-XxeQeY/django/django/contrib/gis/db/models/fields.pyR2�scCst|t�r|St|ttf�r;|d}t}n|}t}t|t�rYnst|ttj	f�s�t
|d�r�yt|�}Wq�tk
r�td��q�Xntdt
|�j��|j|�|_|r|g}|j|d�t|�S|SdS(sF
        Spatial lookup values are either a parameter that is (or may be
        converted to) a geometry, or a sequence of lookup values that
        begins with a geometry.  This routine will setup the geometry
        value properly, and preserve any other lookup parameters before
        returning to the caller.
        it__geo_interface__s,Could not create geometry from lookup value.s?Cannot use object with type %s for a geometry lookup parameter.iN(t
isinstanceRttupletlisttTruetFalseRtbytesRtstring_typesR/Rt
ValueErrorttypet__name__tget_sridRtextend(R)R3tgeomt	seq_valuet
lookup_val((sE/tmp/pip-install-XxeQeY/django/django/contrib/gis/db/models/fields.pytget_prep_value�s*
	'
	
cCsN|j}|dks?|jdks?|dkrF|jdkrF|jS|SdS(s�
        Returns the default SRID for the given geometry, taking into account
        the SRID set for the field.  For example, if the input geometry
        has no SRID, then that of the field will be returned.
        i����N(RR(R)RBtgsrid((sE/tmp/pip-install-XxeQeY/django/django/contrib/gis/db/models/fields.pyR@�s	6cCs9tt|�j||�t||jtt|��dS(N(R'Rtcontribute_to_classtsetattrtattnameRR(R)tclstname((sE/tmp/pip-install-XxeQeY/django/django/contrib/gis/db/models/fields.pyRG�scCs|jj|�S(N(R	tgeo_db_type(R)R((sE/tmp/pip-install-XxeQeY/django/django/contrib/gis/db/models/fields.pytdb_type�scKs�i|jd6|jd6|jd6}|j|�|jdkrvd|krvt|djdt�rvtj	|d<nt
t|�j|�S(Nt
form_classt	geom_typeRitwidgettsupports_3d(
RNRORtupdateR"tgetattrRPR:RtTextareaR'Rt	formfield(R)R*tdefaults((sE/tmp/pip-install-XxeQeY/django/django/contrib/gis/db/models/fields.pyRU�s



cCs�||jjkr�|dkr"gSt|ttf�r�|jj|d�g}||jjkr�||j|d||�7}q�||jjkr�q�||d7}n-t|t	�r�g}n|jj|�g}|St
d||jjf��dS(sC
        Prepare for the database lookup, and return any spatial parameters
        necessary for the query.  This includes wrapping any geometry
        parameters with a backend-specific adapter and formatting any distance
        parameters into the correct units for the coordinate system of the
        field.
        tisnulliis(%s is not a valid spatial lookup for %s.N(
R	t	gis_termsR6R7R8tAdaptertdistance_functionsR2ttruncate_paramsRR=t	__class__R?(R)R4R3Rtpreparedtparams((sE/tmp/pip-install-XxeQeY/django/django/contrib/gis/db/models/fields.pytget_db_prep_lookup�s  	cCs'|dkrt|�S|j|�SdS(NRW(tboolRE(R)R4R3((sE/tmp/pip-install-XxeQeY/django/django/contrib/gis/db/models/fields.pytget_prep_lookup�s
cCs-|dkrdS|jj|j|��SdS(s.Prepares the value for saving in the database.N(RR	RYRE(R)R3R((sE/tmp/pip-install-XxeQeY/django/django/contrib/gis/db/models/fields.pytget_db_prep_savescCs|jj||�S(s^
        Returns the placeholder for the geometry column for the
        given value.
        (R	tget_geom_placeholder(R)R3R((sE/tmp/pip-install-XxeQeY/django/django/contrib/gis/db/models/fields.pytget_placeholders(sDecimal DegreeRN(R?t
__module__t__doc__RORRRNR0t_tdescriptionRR9R:R(R.RRRR1R2RER@RGRMRUR_RaRbRd(((sE/tmp/pip-install-XxeQeY/django/django/contrib/gis/db/models/fields.pyR*s,	5							'	
			$		t
PointFieldcBs#eZdZejZed�ZRS(tPOINTtPoint(R?ReRORRiRNRgRh(((sE/tmp/pip-install-XxeQeY/django/django/contrib/gis/db/models/fields.pyRis	tLineStringFieldcBs#eZdZejZed�ZRS(t
LINESTRINGsLine string(R?ReRORRlRNRgRh(((sE/tmp/pip-install-XxeQeY/django/django/contrib/gis/db/models/fields.pyRls	tPolygonFieldcBs#eZdZejZed�ZRS(tPOLYGONtPolygon(R?ReRORRnRNRgRh(((sE/tmp/pip-install-XxeQeY/django/django/contrib/gis/db/models/fields.pyRns	tMultiPointFieldcBs#eZdZejZed�ZRS(t
MULTIPOINTsMulti-point(R?ReRORRqRNRgRh(((sE/tmp/pip-install-XxeQeY/django/django/contrib/gis/db/models/fields.pyRqs	tMultiLineStringFieldcBs#eZdZejZed�ZRS(tMULTILINESTRINGsMulti-line string(R?ReRORRsRNRgRh(((sE/tmp/pip-install-XxeQeY/django/django/contrib/gis/db/models/fields.pyRs$s	tMultiPolygonFieldcBs#eZdZejZed�ZRS(tMULTIPOLYGONs
Multi polygon(R?ReRORRuRNRgRh(((sE/tmp/pip-install-XxeQeY/django/django/contrib/gis/db/models/fields.pyRu)s	tGeometryCollectionFieldcBs#eZdZejZed�ZRS(tGEOMETRYCOLLECTIONsGeometry collection(R?ReRORRwRNRgRh(((sE/tmp/pip-install-XxeQeY/django/django/contrib/gis/db/models/fields.pyRw.s	N(tdjango.db.models.fieldsRt django.db.models.sql.expressionsRtdjango.utils.translationRRgtdjango.contrib.gisRt"django.contrib.gis.db.models.proxyRt#django.contrib.gis.geometry.backendRRtdjango.utilsRRRRRiRlRnRqRsRuRw(((sE/tmp/pip-install-XxeQeY/django/django/contrib/gis/db/models/fields.pyt<module>s 	�

https://t.me/AnonymousX5 - 2025