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/sql/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/lib64/python2.7/site-packages/django/contrib/gis/db/models/sql/compiler.pyc
�
r�\c@s\ddlZddlmZddlmZmZmZddlmZddl	m
Z
ddlmZddl
mZmZddlmZejZd	ejfd
��YZdejefd��YZd
ejefd��YZdejefd��YZdejefd��YZdejefd��YZdejefd��YZdS(i����N(tsettings(t
truncate_namet
typecast_datettypecast_timestamp(tcompiler(tMULTI(tsix(tziptzip_longest(ttimezonetGeoSQLCompilercBskeZed�Zedddedd�Zdd�Zd�Zddd�Zd�Z	ddd�Z
RS(	cCs|j}|jjj}gtj|jj�D]3\}}d|j|�|d||�f^q.}g}t	|jjj
��}|r�|j�}	n	t	�}	|jjrw|j
�}
x�|jjD]�\}}t|ttf�r	|\}}|jj|j}
|
|
kr*||
|
kr*q�n|j|||�}|r�|d|	kr�dt|	�}|jd||f�|j|�|	j|�q|jd|||d�f�|j|�|	j|d�qp|j|�|j|�|	j|d�q�|j||j�\}}|j|�|j|�t|d�r�|j|j�|	j|j�q�q�WnA|jjr�|j||	�\}}|j|�|j|�n|jjj�}x�|jjj �D]v\}}|j||j�\}}|dkr |j|�n&|jd||t"||��f�|j|�q�Wx�|jj#D]�\\}
}}|j||
|�}|r�||	kr�dt|	�}|jd||f�|j|�|	j|�qd|j|�|j|�|	j|�qdW||_$||fS(s�
        Return the list of columns to use in the select statement. If no
        columns have been specified, returns all columns relating to fields in
        the model.

        If 'with_aliases' is true, any column names that are duplicated
        (without the table names) are given unique aliases. This is needed in
        some cases to avoid ambiguitity with nested queries.

        This routine is overridden from Query to handle customized selection of
        geometry columns.
        s
(%s) AS %siisCol%ds%s AS %staliasN(%tquote_name_unless_aliast
connectiontopst
quote_nameRt	iteritemstquerytextra_selecttget_extra_select_formattsettkeystcopytselecttdeferred_to_columnst
isinstancetlistttuplet	alias_mapt
table_nametget_field_selecttlentappendtaddtas_sqltextendthasattrRtdefault_colstget_default_columnstupdatetmax_name_lengthtaggregate_selecttitemstNoneRtrelated_select_colst_select_aliases(tselftwith_aliasestqntqn2Rtcoltresulttparamstaliasestcol_aliasest	only_loadtfieldtcolumnttabletrtc_aliastcol_sqlt
col_paramstcolstnew_aliasesR(t	aggregatetagg_sqlt
agg_params((sK/tmp/pip-install-XxeQeY/django/django/contrib/gis/db/models/sql/compiler.pytget_columnssx
	L	
!




	
&


	c	Cs�g}|dkr$|jj�}nt�}|j�}	|jjj�}
|r^||
d<nxd|j�D]V\}}|r�|dk	r�t||�r�qkn|jj	||||
�}
|jj
|
j}||	kr�|j|	|kr�qkn|r|j
|
|f�|j|
�qkn|j||
�}|r�|j|kr�dt|�}|j
d||f�|j|�|j|�qk|}|j
|�|j|�|rk|j|j�qkqkW||fS(s�
        Computes the default columns for selecting every field in the base
        model. Will sometimes be called to pull in related models (e.g. via
        select_related), in which case "opts" and "start_alias" will be given
        to provide a starting point for the traversal.

        Returns a list of strings, quoted appropriately for use in SQL
        directly, as well as a set of aliases used in the select statement (if
        'as_pairs' is True, returns a list of (alias, col_name) pairs instead
        of strings as the first component and None as the second component).

        This routine is overridden from Query to handle customized selection of
        geometry columns.
        sCol%ds%s AS %sN(R+Rtget_metaRRtincluded_inherited_modelsRtget_concrete_fields_with_modelt
issubclasstjoin_parent_modelRRR9R R!RR(R.R/R6tstart_aliastoptstas_pairstfrom_parentR3R5R7tseenR8tmodelRR:t	field_selR<R;((sK/tmp/pip-install-XxeQeY/django/django/contrib/gis/db/models/sql/compiler.pyR&fs>	
!



cCsEg}t|jj�}d}|jjjrW|jjdk	sK|jjrWd}qWn|t	|�}gt
|||!|�D]9\}}|jj||jjj
|d�|j�^q~}|jjjs�t|jdt�r*xWt|||�D].\}	}
|j|jj|	|
|j��q�Wn|j||�t|�S(s�
        This routine is necessary so that distances and geometries returned
        from extra selection SQL get resolved appropriately into Python
        objects.
        iit
geo_valuesN(RRRR
Rtoraclet	high_markR+tlow_markRRtconvert_valuestextra_select_fieldstgettgetattrtFalseRR R#R(R.trowtfieldstvaluesR5t	rn_offsettindex_starttvtatvalueR8((sK/tmp/pip-install-XxeQeY/django/django/contrib/gis/db/models/sql/compiler.pytresolve_columns�sS$ )cCsEd}t|jd�rA||jjkrA||jj|}n|S(Ns%st
custom_select(R$RRc(R.Rtsel_fmt((sK/tmp/pip-install-XxeQeY/django/django/contrib/gis/db/models/sql/compiler.pyR�s$cCsU|j|�}||jjkr8||jj|}n||j|||�}|S(s�
        Returns the SELECT SQL string for the given field.  Figures out
        if any custom selection SQL is needed for the column  The `alias`
        keyword may be used to manually specify the database table where
        the column exists, if not in the model associated with this
        `GeoQuery`.  Similarly, `column` may be used to specify the exact
        column name, rather than using the `column` attribute on `field`.
        (tget_select_formatRRct
_field_column(R.R8RR9RdRP((sK/tmp/pip-install-XxeQeY/django/django/contrib/gis/db/models/sql/compiler.pyR�s
	cCs}|jjjrst|d�rs|jjj}|jjry|jjjsW|jjjryd|jj|f}qynd}|S(s.
        Returns the selection format string, depending on the requirements
        of the spatial backend.  For example, Oracle and MySQL require custom
        selection formats in order to retrieve geometries in OGC WKT. For all
        other fields a simple '%s' format string is returned.
        t	geom_types'SRID=%d;'||%ss%s(R
RRR$Rttransformed_sridRRt
spatialite(R.tfldRd((sK/tmp/pip-install-XxeQeY/django/django/contrib/gis/db/models/sql/compiler.pyRe�scCsP|dkr!|jj�j}nd|j|�|jjj|pH|j�fS(s�
        Helper function that returns the database column for the given field.
        The table and column are returned (quoted) in the proper format, e.g.,
        `"geoapp_city"."point"`.  If `table_alias` is not specified, the
        database table associated with the model of this `GeoQuery` will be
        used.  If `column` is specified, it will be used instead of the value
        in `field.column`.
        s%s.%sN(	R+RREtdb_tableRR
RRR9(R.R8ttable_aliasR9((sK/tmp/pip-install-XxeQeY/django/django/contrib/gis/db/models/sql/compiler.pyRf�s	N((t__name__t
__module__RYRDR+R&RbRRReRf(((sK/tmp/pip-install-XxeQeY/django/django/contrib/gis/db/models/sql/compiler.pyR

sW4!		tSQLInsertCompilercBseZRS((RmRn(((sK/tmp/pip-install-XxeQeY/django/django/contrib/gis/db/models/sql/compiler.pyRo�stSQLDeleteCompilercBseZRS((RmRn(((sK/tmp/pip-install-XxeQeY/django/django/contrib/gis/db/models/sql/compiler.pyRp�stSQLUpdateCompilercBseZRS((RmRn(((sK/tmp/pip-install-XxeQeY/django/django/contrib/gis/db/models/sql/compiler.pyRqstSQLAggregateCompilercBseZRS((RmRn(((sK/tmp/pip-install-XxeQeY/django/django/contrib/gis/db/models/sql/compiler.pyRrstSQLDateCompilercBseZdZd�ZRS(s�
    This is overridden for GeoDjango to properly cast date columns, since
    `GeoQuery.resolve_columns` is used for spatial values.
    See #14648, #16757.
    ccs�|jjjr.ddlm}|�g}n|jjj}t|jj	�}x�|j
t�D]�}x�|D]y}||}|jjjr�|j||�|}n|r�t
t|��}nt|tj�r�|j�}n|VqlWq_WdS(Ni����(t
DateTimeField(R
RRRtdjango.db.models.fieldsRttfeaturestneeds_datetime_string_castRRRtexecute_sqlRRbRtstrRtdatetimetdate(R.RtR[tneeds_string_casttoffsettrowsRZR{((sK/tmp/pip-install-XxeQeY/django/django/contrib/gis/db/models/sql/compiler.pytresults_iters

(RmRnt__doc__R(((sK/tmp/pip-install-XxeQeY/django/django/contrib/gis/db/models/sql/compiler.pyRsstSQLDateTimeCompilercBseZdZd�ZRS(s�
    This is overridden for GeoDjango to properly cast date columns, since
    `GeoQuery.resolve_columns` is used for spatial values.
    See #14648, #16757.
    ccs|jjjr.ddlm}|�g}n|jjj}t|jj	�}x�|j
t�D]�}x�|D]�}||}|jjjr�|j||�|}n|r�t
t|��}ntjr�|jdd�}tj||jj�}n|VqlWq_WdS(Ni����(Rtttzinfo(R
RRRRuRtRvRwRRRRxRRbRRyRtUSE_TZtreplaceR+R	t
make_awareR�(R.RtR[R|R}R~RZRz((sK/tmp/pip-install-XxeQeY/django/django/contrib/gis/db/models/sql/compiler.pyR%s 

	(RmRnR�R(((sK/tmp/pip-install-XxeQeY/django/django/contrib/gis/db/models/sql/compiler.pyR�s(Rztdjango.confRtdjango.db.backends.utilRRRtdjango.db.models.sqlRtdjango.db.models.sql.constantsRtdjango.utilsRtdjango.utils.six.movesRRR	tSQLCompilerR
RoRpRqRrRsR�(((sK/tmp/pip-install-XxeQeY/django/django/contrib/gis/db/models/sql/compiler.pyt<module>s	�

https://t.me/AnonymousX5 - 2025